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

Sergii
55
accept rate: 0%


Hi,

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:

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:

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

in your virtualhosts to honor local php.ini files.

Hope that helps!

link

answered 03 Oct '11, 23:31

neeravk's gravatar image

neeravk
1.5k1411
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
</IfModule>
link

answered 03 Oct '11, 16:04

Sergii's gravatar image

Sergii
55
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

By RSS:

Answers

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

Tags:

×184
×170

Asked: 03 Oct '11, 15:16

Seen: 1,361 times

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