简体   繁体   English

更新XAMPP破坏了PHP网页执行

[英]Updating XAMPP broke php web page execution

I use a windows 10 64-bit desktop and a windows 10 also 64-bit laptop. 我使用Windows 10 64位桌面和Windows 10 64位笔记本电脑。 This has happened on both computers. 两台计算机上都发生了这种情况。

After doing a complete uninstall of an old version of XAMPP(in Admin account), I reinstalled the newest version (xampp-win32-7.3.1-0-VC15-installer.exe as an Admin with Firewall and virus protection disabled). 完全卸载旧版本的XAMPP(在Admin帐户中)后,我重新安装了最新版本(xampp-win32-7.3.1-0-VC15-installer.exe作为具有防火墙和病毒防护功能的Admin管理员)。

I verified the install by typing localhost/ into my Chrome brower and it came up with the XAMPP web page at localhost/dashboard. 我通过在Chrome浏览器中输入localhost /来验证安装,然后XAMPP网页出现在localhost / dashboard上。

I then loaded the db backup into phpMyAdmin 4.8.4. 然后,我将数据库备份加载到phpMyAdmin 4.8.4中。 And I copied the backup folder of my pages into htdocs. 然后将页面的备份文件夹复制到htdocs中。

But now the php web pages that displayed correctly in the old version now throw this error on some pages, not all. 但是现在,在旧版本中正确显示的php网页现在在某些页面(而非全部)上引发此错误。

Warning: require_once(/includes/session.php): failed to open stream: No such file or directory in C:\xampp\htdocs\my_rabbits\my_profile.php on line 1

Fatal error: require_once(): Failed opening required '/includes/session.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\my_rabbits\my_profile.php on line 1

I checked the paths and they are all correct - no misspellings. 我检查了路径,它们都是正确的-没有拼写错误。 My includes folder is in htdocs as is the individual my_profile.php page. 我的include文件夹和单独的my_profile.php页面都位于htdocs中。 Here is what line 1 looks like of my_profile.php page: 这是my_profile.php页面的第1行:

<?php require_once("/includes/session.php"); ?>

Here is what my includes/session.php code looks like: 这是我的include / session.php代码的样子:

<?php

   session_start();

   function message() {
      if (isset($_SESSION["message"])) {
         $output = "<div class=\"message\">";
         $output .= htmlentities($_SESSION["message"]);
         $output .= "</div>";

         // clear message after use
         $_SESSION["message"] = null;

         return $output;
      }
   }

   function errors() {
      if (isset($_SESSION["errors"])) {
         $errors = $_SESSION["errors"];

         // clear message after use
         $_SESSION["errors"] = null;

         return $errors;
      }
   }

?>

Thanks for any help you could give. 感谢您提供的任何帮助。 I am a novice user and navigating in unknown waters... 我是新手,正在未知水域中航行...

php.ini中的include_path-没有当前路径

include_path = ".;C:\xampp\php\PEAR"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM