当前位置: 首页 > 工具软件 > Restler > 使用案例 >

php restler,PHP Restler Server 500错误(PHP Restler Server 500 Error)

欧阳何平
2023-12-01

I've installed restler using composer. I've set up a virtual host for it. I'm able to go to my localhost in my browser and it shows some informational pages but as soon as I try one of the APIs I get a server 500 error.

My PHP logs say:

Function main

Error Type E_ERROR

Source File /public/examples/_001_helloworld/index.php : 18

Error String Class 'Luracast\Restler\Restler' not found

I'm using the example code straight out of the project. It looks like it has the require_once '../../../vendor/restler.php' and it seems to still have 500 errors.

I'm using PHP 5.4.16 on a Mac.

Update

Here are all of my logs:

[05-Sep-2013 17:05:09 America/Denver] PHP Warning: include(/Users/ChrisLondon/composer/autoload_classmap.php): failed to open stream: No such file or directory in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 432

[05-Sep-2013 17:05:09 America/Denver] PHP Warning: include(): Failed opening '/Users/ChrisLondon/composer/autoload_classmap.php' for inclusion (include_path='.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear:/opt/local/lib/php') in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 432

[05-Sep-2013 17:05:09 America/Denver] PHP Warning: include(/Users/ChrisLondon/composer/autoload_namespaces.php): failed to open stream: No such file or directory in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 432

[05-Sep-2013 17:05:09 America/Denver] PHP Warning: include(): Failed opening '/Users/ChrisLondon/composer/autoload_namespaces.php' for inclusion (include_path='.:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear:/opt/local/lib/php') in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 432

[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_values() expects parameter 1 to be array, boolean given in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 154

[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_merge(): Argument #2 is not an array in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 155

[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_merge(): Argument #1 is not an array in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 155

[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_map(): Argument #2 should be an array in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 166

[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_filter() expects parameter 1 to be array, null given in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 166

[05-Sep-2013 17:05:09 America/Denver] PHP Warning: natsort() expects parameter 1 to be array, null given in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 167

[05-Sep-2013 17:05:09 America/Denver] PHP Warning: array_unique() expects parameter 1 to be array, null given in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 170

[05-Sep-2013 17:05:09 America/Denver] PHP Warning: implode(): Invalid arguments passed in /Users/ChrisLondon/personal/SuperfyMe/vendor/Luracast/Restler/AutoLoader.php on line 170

[05-Sep-2013 17:05:09 America/Denver] PHP Fatal error: Class 'Luracast\Restler\Restler' not found in /Users/ChrisLondon/personal/SuperfyMe/public/examples/_001_helloworld/index.php on line 19

It seems like it's trying to find the autoload class here: /Users/ChrisLondon/composer/autoload_classmap.php but the file is actually here: /Users/ChrisLondon/personal/SuperfyMe/vendor/composer/autoload_classmap.php

 类似资料: