login community faq

Hello, I've recently migrated to web225 server and trying to make all my PHP apps work, as nicely explained here http://docs.webfaction.com/software/php.html

There are some problems with config changes: .htaccess php_value to per application php.in. While they work on Webfaction, I also need them to work on my local server.

Can you please tell how can I configure my Apache and PHP 5.3 (at Ubuntu) to handle these php.ini files properly? For now they are simply ignored.

asked Oct 03 '11 at 15:16

Sergii's gravatar image

Sergii
53


Hi,

You can install PHP as CGI using:

1
2
apt-get install php5-cgi
apt-get install php5-mysql

You then need to add:

1
2
3
ScriptAlias /local-bin /usr/bin
AddHandler application/x-httpd-php5 php
Action application/x-httpd-php5 /local-bin/php-cgi

to your httpd.conf

You then need to add:

1
2
3
4
5
6
7
error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
display_errors = Off
log_errors = On
error_log = /var/log/php.log
max_execution_time = 300
memory_limit = 64M
register_globals = Off

or any other global setting you need to /etc/php5/cgi/php.ini

You then need to use:

1
SetEnv PHP_INI_SCAN_DIR "/this/vhosts/php/ini/folder"

in your virtualhosts to honor local php.ini files.

Hope that helps!

answered Oct 03 '11 at 23:31

neeravk's gravatar image

neeravk ♦♦
14061311

Yes, it makes sense: I need to install PHP as CGI first. Thanks for the confirmation.

(Oct 04 '11 at 03:09) Sergii Sergii's gravatar image

Not a real solution, but because my local Apache configured with mod_php I've used following workaround:

1
2
3
<IfModule mod_php5.c>
    php_value xxx yyy
</IfModule>

answered Oct 03 '11 at 16:04

Sergii's gravatar image

Sergii
53

Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×150
×147

Asked: Oct 03 '11 at 15:16

Seen: 905 times

Last updated: Oct 04 '11 at 03:09

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited