Difference between revisions of "PHP.ini"

From KOP KB
Jump to: navigation, search
(Summary)
(Summary)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Summary ==
 
== Summary ==
php.ini or user.ini(since php 5.3) you can use to modify certain things of the php application
+
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 ==
 
== SSH Method for Custom INI ==
Line 15: Line 15:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
3) Using FTP upload the php.cgi to your cgi-bin directory.
 
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
 
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:  
 
5) In a SSH Program (ie. Putty): Enter the following command to set the executable bit on your wrapper:  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 22: Line 24:
 
6) In Notepad: Create an .htaccess file containing the following lines:  
 
6) In Notepad: Create an .htaccess file containing the following lines:  
 
<syntaxhighlight lang="apache">
 
<syntaxhighlight lang="apache">
AddHandler application/my-php  
+
AddHandler application/my-php .php  
.php Action application/my-php /cgi-bin/php.cgi
+
Action application/my-php /cgi-bin/php.cgi
 
</syntaxhighlight>
 
</syntaxhighlight>
 
7) Using FTP upload the .htaccess file to the directory in which you want to use the settings
 
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
 
8) Change any settings you need in the php.ini file in your home directory and use phpinfo to ensure that they’re set
  

Latest revision as of 18:06, 25 November 2014

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