Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So, i'm trying to use Silex on my dreamhost account and I'm getting an error

Fatal error: Class 'Phar' not found in blah blah blah...

when I try to include the Silex.phar file. When I look at phpinfo(), there isn't a section for Phar, even though everything I've seen claims that Phar support should be included by default in php 5.3.whatever, which is what i'm running under. Any Ideas?

share|improve this question

3 Answers 3

I found you have to put some more lines in the phprc file for it to work in FastCGI mode

extension=phar.so
detect_unicode = Off
phar.readonly = Off
phar.require_hash = Off
suhosin.executor.include.whitelist = phar
share|improve this answer
up vote 1 down vote accepted

Figured it out. If you add a directory at ~/.php/5.3/ and then put a file called phprc in it with the following line in it

extension=phar.so

then the phar extension gets loaded.

share|improve this answer
    
how can i navigate to this directory? its not there in the FTP –  Harsha M V Dec 31 '13 at 6:16

You will generally not be able to enable/disable things in the PHP configuration on a shared host. There are a number of things that can often be tweaked with settings in .htaccess files depending on your host's setup, but enabling modules/libraries is not one of them.

Most hosts do not run entirely with the default PHP options for one reason or another, so even though it is included by default in the standard distribution you can not rely on finding in included on any given host.

You need to contact your host. They may be willing to enable the feature for you if it is something that might be useful to their customers more generally, or it may be something they already have enabled on some hosts (but have more rolled out to all yet) in which case they could move your account to a server that has it already.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.