SecStone SecStone -4 years ago 269
PHP Question

PHP: Class 'Phar' not found

I try to use the Silex framework as base for my web application. However, if I try to include the *.phar archive, PHP throws the following error:

Fatal error: Class 'Phar' not found in /var/www/framework/silex.phar on line 11

The following relevant lines are in my
(as suggested in the docs of Silex):
phar.readonly = Off
phar.require_hash = Off
detect_unicode = Off

The PHAR library is present in
which is set as the extension path for all libraries in my

Does anyone know why PHP is throwing this error?

Answer Source

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

  • You are using a different php.ini. Check the output of phpinfo() to confirm.

  • /usr/lib/php/modules/ is not readable.

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download