我已经安装了梨和使用sudo php_beautifier ...PHP_Beautifier - 致命错误 - 需要对PEAR.php
从我读过,我应该能够使用命令
php_beautifier x.php
格式化代码但是,当我尝试这样做,我得到这个错误:
Warning: require_once(PEAR.php): failed to open stream: No such file or directory in /Users/philip/pear/bin/php_beautifier on line 37
Fatal error: require_once(): Failed opening required 'PEAR.php' (include_path='.:') in /Users/philip/pear/bin/php_beautifier on line 37
我已经看了看php_beautifier.php代码,我不知道什么是错的。第37行:
require_once 'PEAR.php';
并且该文件与pear.php位于相同的目录中?
'whereis'对PEAR.php在什么位置? –
@SalmanA Ahh我的坏,我有梨,但不是pear.php在我的文件夹中。只是复制梨的一个版本并将其命名为pear.php在同一文件夹中安全吗? – Philip
也许你不需要。做一个'php -i> phpinfo.txt',打开文件并记下'include_path'的值。如果它包含有效的'/ path/to/the/folder/that/contains/PEAR.php',那么问题就在其他地方。否则,你只需要在php.ini文件中添加/编辑路径。 –