Oleg.Gricik

Well-Known Member
Nov 2, 2011
62
0
56
cPanel Access Level
Root Administrator
Hi

We are experiencing some problems with local php.ini file.
When we put local php.ini with couple options, for example:
memory_limit = 128M
upload_max_filesize =10M
We can't found a php.ini file from which other options(variables) are taken.
I'm sure that this php.ini isn't located under /usr/local/lib/php.ini
As according to phpinfo() variables(options) from local php.ini are different from /usr/local/lib/php.ini

Does it use some cPanel's PHP.ini file?
Where does it locate?
How can we change it?
 

thewebhosting

Well-Known Member
May 9, 2008
1,201
1
68
Check in /usr/lib. There should be main php.ini file located.
 

Oleg.Gricik

Well-Known Member
Nov 2, 2011
62
0
56
cPanel Access Level
Root Administrator
it isn't /usr/lib/php.ini
Our main php.ini is located here:
/usr/local/lib/

But when our clients use their local php.ini file with couple options, other options are taken from mysterious php.ini file

Where is this mysterious php.ini file?
 

thewebhosting

Well-Known Member
May 9, 2008
1,201
1
68
Do you wish to set custom features in php.ini for particular accounts?

You can copy main php.ini file to account's public_html folder and then make necessary changes in php.ini file as per your requirement. You need to make sure that the ownership of this file should be user:user once you copy to new location.

Also, try using phpinfo() page on account to see it loads the custom php.ini file instead of main php.ini file.
 

Oleg.Gricik

Well-Known Member
Nov 2, 2011
62
0
56
cPanel Access Level
Root Administrator
he he,
I'm always doing this, but I want to know where the mysterious php.ini file is located.
For unknown reason it doesn't include couple functions.
If we can locate it, then we will be able to correct them
As The result, it will decrease amount of requests from our clients.
 

Oleg.Gricik

Well-Known Member
Nov 2, 2011
62
0
56
cPanel Access Level
Root Administrator
Configure Command => './configure' '--disable-cgi' '--enable-bcmath' '--enable-calendar' '--enable-dbase' '--enable-exif' '--enable-fastcgi' '--enable-force-cgi-redirect' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared' '--enable-safe-mode' '--enable-soap' '--enable-sockets' '--enable-wddx' '--enable-zend-multibyte' '--enable-zip' '--prefix=/usr/local' '--with-bz2' '--with-config-file-path=/usr/local/lib' '--with-config-file-scan-dir=/usr/local/lib/php.ini.d' '--with-curl=/opt/curlssl/' '--with-curlwrappers' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libexpat-dir=/usr' '--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash=/opt/mhash/' '--with-mime-magic' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pic' '--with-png-dir=/usr' '--with-pspell' '--with-sqlite=shared' '--with-tidy=/opt/tidy/' '--with-ttf' '--with-xmlrpc' '--with-xpm-dir=/usr' '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr'
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini
Scan this dir for additional .ini files => /usr/local/lib/php.ini.d
But /usr/local/lib/php.ini.d doesn't work.
I've already tested this.

Any suggestions?

Actually, I've run php -i|grep php.ini using root privileges.
 
Last edited:

thewebhosting

Well-Known Member
May 9, 2008
1,201
1
68
Your mysterious php.ini should be same as /usr/local/lib/php.ini. Do you have only one PHP version installed OR multiple versions?