且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PHP:找不到类"Phar"

更新时间:2022-06-10 19:12:22

尝试指定扩展名的路径:

php -d extension=phar.so composer.phar <your_script>

其他选项:

根据您提供的信息,有几种可能性:

Based on the information you provided, there are a few possibilities:

  • 您正在使用其他php.ini.检查phpinfo()的输出进行确认,并确保您正在编辑活动目录.

  • You are using a different php.ini. Check the output of phpinfo() to confirm, and ensure that you are editing the active one.

/usr/lib/php/modules/phar.so不可读.确保Web服务器用户可以读取此文件.

/usr/lib/php/modules/phar.so is not readable. Ensure that the web server user can read this file.

自从您上次将与phar相关的信息添加到php.ini中以来,您的Web服务器尚未重新启动.重新启动您的网络服务器.

Your web server has not been restarted since you last added the phar-related information to php.ini. Restart your webserver.