add a note

User Contributed Notes 8 notes

up
16
jaw at jawspeak dot com - Jonathan Andrew Wolte
18 years ago
Be sure to use double quotes in the php.ini file. For instance:(lines broken for readability)this will work:# xdebug debuggingzend_extension="/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so"this won't:# xdebug debuggingzend_extension='/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so'You'll get this error: Failed loading '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so':  (null)So... double quotes are the way! I know this is obvious, but it's a good thing to remember for the php.ini file.
up
11
henrick at streamsec dot se
18 years ago
In order to get PHP 5.2 stable running on Windows Server 2003 x64 (IIS 6.0), I discovered three things (in addition to the other comments above):* Some PHP web applications make use of the SCRIPT_NAME server variable which is not available under CGI. You have to use php5isapi.dll, which is a 32 bit dll, so you have to run IIS in 32 bit mode. Confer http://support.microsoft.com/kb/894435. This applies to all ISAPI extensions and not just ASP.NET.* It appears you must leave the doc_root entry in php.ini blank. At least, that is what finally made my installation work. (Note that others have suggested to set it to e.g. C:\inetpub\wwwroot or equivalent. That won't work if your server hosts more than one domain, each placed in a separate directory.)* If you are e.g. using MySQL you will have to edit php.ini. In order for it to be found, you must set the PHPRC system environment variable or the registry entry. Note that if you edit the registry using regedit.exe, the PHP key should be placed under the [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node] key. This happens automatically if you set it using a 32 bit legacy application.
up
11
alvaro at demogracia dot com
18 years ago
About Apache 2.0 module:For whatever reason, the Windows installer for PHP/5.2.3 tries to set the PHPIniDir directive using "\\" as directory separator:PHPIniDir "C:\\Archivos de programa\\PHP\\"It didn't work for me until I edited httpd.conf and replaced it with "/":PHPIniDir "C:/Archivos de programa/PHP/"
up
9
randy AT rcs-comp DOT com
20 years ago
(copied from another page)Please note that the SetEnv PHPRC "directory/to/phpini/" only works when using PHP as CGI, but _not_ when you use the PHP Apache Module!
up
8
salivatears at gmail dot com
14 years ago
For windows with limited file permission (Windows XP)1. Install Apache in your folder profile "C:\Documents and Settings\your_profile"2. Add the following directives to you httpd.confPHPINIDir "C:\Documents and Settings\your_profile\php"LoadModule php5_module "C:\Documents and Settings\your_profile\php\php5apache2_2.dll"AddType application/x-httpd-php .php3. Edit the following directive to you php.iniextension_dir = "C:\Documents and Settings\your_profile\php\ext"4. Move the file libmysql.dll from C:\Documents and Settings\your_profile\php\ to C:\Documents and Settings\your_profile\php\ext\5. Restart httpd using command line
up
9
c dot affolter at stepping-stone dot ch
19 years ago
For those people who want to use the PHPRC environment variable:You have to specify the path to the directory containing your php.ini, not the direct path to the php.ini.Example (php.ini resides in /your/path/php.ini):right:export PHPRC=/your/pathwrong:export PHPRC=/your/path/php.ini
up
8
cduke420 at gmail dot com
18 years ago
[ When php run as Apache Module ]DOCUMENT_ROOT .htaccess+======================================+SetEnv PHPRC /home/user/dir-containing-phpinifile+======================================+[ When php run as CGI ]Place your php.ini file in the dir of your cgi'd php binary, in this case /cgi-bin/DOCUMENT_ROOT .htaccess+======================================+AddHandler php-cgi .php .htmAction php-cgi /cgi-bin/php5.cgi+======================================+[ PHP run as cgi with wrapper (for FastCGI) ]Your wrapper script should look something like:+======================================+#!/bin/shexport PHP_FCGI_CHILDREN=3exec /user/htdocs/cgi-bin/php.cgi -c /home/user/php.ini+======================================+original article:http://www.askapache.com/2007/php/custom-phpini-tips-and-tricks.html
up
7
goran
11 years ago
To run separate apache and php processes on centos (at least) withouthaving to compile and install separate versions for every instancethis should work:Install apache and php with yum.This will give you (for the first instance):/etc/httpd/*, /etc/sysconfig/httpd, /etc/init.d/httpd, /etc/php.iniand /etc/php.d/*.Copy all this stuff to:/etc/httpd2/*, /etc/sysconfig/httpd2, /etc/init.d/httpd2,  /etc/php2.iniand /etc/php2.d/*.Then:Edit the apache config files in /etc/httpd2/* to reflect the newports you want to have this apache listen on (don't forget ssl.confunder conf.d) and any other differing settings, like log filedestinations and virtualhosts.Edit the php2.ini for any specific settings you want the other php instance to have.To have a completely separate php in this new apache instance with its ownmodules included, edit /etc/sysconfig/httpd2 and add the following:PHPRC=/etc/php2.iniexport PHPRCPHP_INI_SCAN_DIR=/etc/php2.dexport PHP_INI_SCAN_DIRThis will set the environment variables for the second apache/phpinstance before it is started.Then edit /etc/init.d/httpd2 and change all references to httpd(like lockfile, pidfile and sysconfig) to httpd2. Don't touch theexecutable name, though :)And change this:LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONSto this:LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd -f /etc/httpd2/conf/httpd.conf $OPTIONS.. so this apache can find its own configuration file.Then, if necessary 'chkconfig --add /etc/init.d/httpd2' to have itin startup and you should have two apache instances with two separatephp modules with their own dedicated settings.
To Top