Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP use关键字导致500服务器错误_Php_Namespaces - Fatal编程技术网

PHP use关键字导致500服务器错误

PHP use关键字导致500服务器错误,php,namespaces,Php,Namespaces,我正在尝试实现PhpPresentation以转换一些文件,因此我有以下代码: use PhpOffice\PhpPresentation\src\PhpPresentation\PhpPresentation; use PhpOffice\PhpPresentation\src\PhpPresentation\IOFactory; use PhpOffice\PhpPresentation\src\PhpPresentation\Style\Color; use PhpOffice\PhpPr

我正在尝试实现PhpPresentation以转换一些文件,因此我有以下代码:

use PhpOffice\PhpPresentation\src\PhpPresentation\PhpPresentation;
use PhpOffice\PhpPresentation\src\PhpPresentation\IOFactory;
use PhpOffice\PhpPresentation\src\PhpPresentation\Style\Color;
use PhpOffice\PhpPresentation\src\PhpPresentation\Style\Alignment;
由于某种原因,这段代码正是导致500个内部服务器错误的原因。我已将错误报告设置为“全部”,但未显示任何错误。路径是正确的,我的根目录中有PhpOffice文件夹(public_html)和相应的子文件夹

自动加载程序代码的加载方式如下:

require_once 'PhpOffice/PhpPresentation/src/PhpPresentation/Autoloader.php';
  \PhpOffice\PhpPresentation\Autoloader::register();
  require_once 'PhpOffice/src/Common/Autoloader.php';
  \PhpOffice\Common\Autoloader::register();

由于此,问题已修复


我在一个函数中使用了“use”,这是错误的,也是错误的原因。

请查看http服务器错误日志文件,在该文件中,您可以读取实际问题。最有可能的是,自动加载程序找不到这些定义。
语法错误,第一行出现意外的“use”
。以下是我的全部功能和一些想法:在
use
行之前是否有任何行?可能是一个缺少
?确定一下……你的PHP版本是什么?好的,这意味着你的PHP版本很可能已经过时,并且低于
5.6
。您想要升级。