PHP.ini

From KOP KB
Jump to: navigation, search

Summary

php.ini or .user.ini(since php 5.3) you can use to modify certain things of the php application

SSH Method for Custom INI

This will require you have access to SSH, on may be required the way you do it on some servers. 1) In a SSH Program (ie. Putty): Enter the following commands to copy the system’s default php.ini into your home directory:

cp /etc/php.ini ~/

2) In notepad: Create a cgi wrapper named php.cgi

#!/bin/sh 
exec /var/www/cgi-bin/php -c ~/php.ini

3) Using FTP upload the php.cgi to your cgi-bin directory.

4) In a SSH Program (ie. Putty): enter the following to change directory to cgi-bin: cd cgi-bin

5) In a SSH Program (ie. Putty): Enter the following command to set the executable bit on your wrapper:

chmod +x php.cgi

6) In Notepad: Create an .htaccess file containing the following lines:

AddHandler application/my-php .php 
Action application/my-php /cgi-bin/php.cgi

7) Using FTP upload the .htaccess file to the directory in which you want to use the settings

8) Change any settings you need in the php.ini file in your home directory and use phpinfo to ensure that they’re set

Memory Limit

Usually is the most often change depending on the requirement of what has been developed

The command is below that you would insert in one of the lines of the INI file. memory_limit = 64M