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 03 Oct '11, 15:16

Sergii's gravatar image

accept rate: 0%


You can install PHP as CGI using:

apt-get install php5-cgi
apt-get install php5-mysql

You then need to add:

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:

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:

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

in your virtualhosts to honor local php.ini files.

Hope that helps!

permanent link

answered 03 Oct '11, 23:31

neeravk's gravatar image

accept rate: 41%

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

(04 Oct '11, 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:

<IfModule mod_php5.c>
    php_value xxx yyy
permanent link

answered 03 Oct '11, 16:04

Sergii's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 03 Oct '11, 15:16

question was seen: 2,407 times

last updated: 04 Oct '11, 03:09

Features & prices    Sign up    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
© Copyright 2003-2015 Swarma Limited - WebFaction is a service of Swarma Limited