PHP: Difference between revisions

From Psygen Wiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 8: Line 8:
'''Easy Apache 3 PHP.ini location:'''<br />
'''Easy Apache 3 PHP.ini location:'''<br />
<code>/usr/local/lib/php.ini</code>
<code>/usr/local/lib/php.ini</code>


'''Easy Apache 4 php.ini location:'''<br />
'''Easy Apache 4 php.ini location:'''<br />
Line 15: Line 17:


'''Example path:'''
'''Example path:'''
<code>/opt/cpanel/ea-php70/php.ini</code>
<code>/opt/cpanel/ea-php70/root/etc/php.ini</code>
 


'''Find all the ini's!'''<br />
'''Find all the ini's!'''<br />
<code>php --ini</code> - Find all the php.ini files that PHP looks in for configuration directives.
<code>php --ini</code> - Find all the php.ini files that PHP looks in for configuration directives.
'''Search in all the configs:''' (cd to the php version directory first)<br />
<code>grep -lr search_term *</code>





Latest revision as of 22:53, 11 August 2017

PHP.ini

php.ini is the configuration file for PHP.

Q: Where is php.ini?

A: Beats me, the @#%&*$ thing could be anywhere. On top of that, each site/folder can have a php.ini that overrides the global settings for that site/folder.

Easy Apache 3 PHP.ini location:
/usr/local/lib/php.ini


Easy Apache 4 php.ini location:
¯\_(ツ)_/¯

/opt/cpanel/ea-php**/root/etc/ - (replace ** with the php version) Each version of PHP may (or may not) have it's own global ini. You can use these, but each directory on the website may or may not have its own php.ini

Example path: /opt/cpanel/ea-php70/root/etc/php.ini


Find all the ini's!
php --ini - Find all the php.ini files that PHP looks in for configuration directives.

Search in all the configs: (cd to the php version directory first)
grep -lr search_term *


In WHM:
Home >> Software >> MultiPHP INI Editor

Modules

php -m - Lists all installed PHP modules.

php -i - Shows other information about the PHP build.

Version

See: Software Versions to check the installed version.

You can also run the below at the command line to check the php version:
php -v

/usr/local/cpanel/bin/rebuild_phpconf --current - view PHP handler


Easy Apache 4

You can run the following to get lots of info on PHP:

/usr/local/cpanel/bin/rebuild_phpconf --current


Use SCL to run commands as that php version:

scl enable ea-php56 'php -v' - runs "php -v" as php 5.6

References