1

Never had this problem till updated CPanel today? Maybe that is part the problem?

I only have the one php.ini file

# /usr/local/bin/php --info | grep php.ini
Configure Command =>  './configure'  '--disable-cgi' '--disable-fileinfo' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared' '--enable-soap' '--enable-sockets' '--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-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-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-xmlrpc' '--with-xpm-dir=/usr' '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr' '--with-gettext'
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

# /usr/bin/php --info | grep php.ini
<tr><td class="e">Configure Command </td><td class="v"> &#039;./configure&#039;  &#039;--disable-fileinfo&#039; &#039;--enable-bcmath&#039; &#039;--enable-calendar&#039; &#039;--enable-exif&#039; &#039;--enable-ftp&#039; &#039;--enable-gd-native-ttf&#039; &#039;--enable-libxml&#039; &#039;--enable-magic-quotes&#039; &#039;--enable-mbstring&#039; &#039;--enable-pdo=shared&#039; &#039;--enable-soap&#039; &#039;--enable-sockets&#039; &#039;--enable-zip&#039; &#039;--prefix=/usr&#039; &#039;--with-bz2&#039; &#039;--with-config-file-path=/usr/local/lib&#039; &#039;--with-config-file-scan-dir=/usr/local/lib/php.ini.d&#039; &#039;--with-curl=/opt/curlssl/&#039; &#039;--with-curlwrappers&#039; &#039;--with-freetype-dir=/usr&#039; &#039;--with-gd&#039; &#039;--with-imap=/opt/php_with_imap_client/&#039; &#039;--with-imap-ssl=/usr&#039; &#039;--with-jpeg-dir=/usr&#039; &#039;--with-kerberos&#039; &#039;--with-libdir=lib64&#039; &#039;--with-libexpat-dir=/usr&#039; &#039;--with-libxml-dir=/opt/xml2&#039; &#039;--with-libxml-dir=/opt/xml2/&#039; &#039;--with-mcrypt=/opt/libmcrypt/&#039; &#039;--with-mysql=/usr&#039; &#039;--with-mysql-sock=/var/lib/mysql/mysql.sock&#039; &#039;--with-mysqli=/usr/bin/mysql_config&#039; &#039;--with-openssl=/usr&#039; &#039;--with-openssl-dir=/usr&#039; &#039;--with-pcre-regex=/opt/pcre&#039; &#039;--with-pdo-mysql=shared&#039; &#039;--with-pdo-sqlite=shared&#039; &#039;--with-pic&#039; &#039;--with-png-dir=/usr&#039; &#039;--with-pspell&#039; &#039;--with-sqlite=shared&#039; &#039;--with-tidy=/opt/tidy/&#039; &#039;--with-xmlrpc&#039; &#039;--with-xpm-dir=/usr&#039; &#039;--with-xsl=/opt/xslt/&#039; &#039;--with-zlib&#039; &#039;--with-zlib-dir=/usr&#039; </td></tr>
<tr><td class="e">Configuration File (php.ini) Path </td><td class="v">/usr/local/lib </td></tr>
<tr><td class="e">Loaded Configuration File </td><td class="v">/usr/local/lib/php.ini </td></tr>
<tr><td class="e">Scan this dir for additional .ini files </td><td class="v">/usr/local/lib/php.ini.d </td></tr>

everytime I restart apache I still seem to be running the old one. Nothing changes.

I removed phpinfo() and ini_set() from the php.ini but I still can't use them.

# service httpd -k restart
[Fri Oct 26 15:27:10 2012] [warn] module hostinglimits_module is already loaded, skipping
[Fri Oct 26 15:27:10 2012] [warn] NameVirtualHost 127.0.0.1:8081 has no VirtualHosts

There is also no php.ini files under the vhosts or .htaccess.

# /usr/bin/php -v
PHP 5.3.15 (cgi-fcgi) (built: Aug  4 2012 21:33:58)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
    with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
    with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd., and
    with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
    with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH

and

# /usr/local/bin/php -v
PHP 5.3.15 (cli) (built: Aug  4 2012 21:34:27)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
    with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
    with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd., and
    with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
    with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH

Nothing shows up in the error logs either. The only errors we get are under the vhost's with error_log saying phpinfo and ini_set are disabled.

EDIT: Both php binaries use the same php.ini file

EDIT: Running php as mod_fgcid.so with suexec

EDIT: From SSH I see the correct values for PHP from the php.ini file being loaded from both binaries

When using php from apache [26-Oct-2012 20:25:34 UTC] PHP Warning: phpinfo() has been disabled for security reasons in /home/jake/public_html/phpinfo.php on line 1

EDIT: /usr/bin/php is the correct PHP file. Forgot to mention. It is the one in the wrapper script.

3
  • 1
    The INI used for the CLI version of PHP could be completely different from the version used by the apache module or cgi version you have installed. They are separate instances of PHP. You need to look at the phpinfo() output in Apache.
    – Zoredache
    Oct 26, 2012 at 19:45
  • Trying to do that.. I've edited all the php.ini files and removed phpinfo() but still blocks it so I can't even access it Apache ;/ Oct 26, 2012 at 19:49
  • This question appears to be off-topic because it is about working with a service provider's management interface, such as cPanel. Jan 13, 2015 at 20:40

2 Answers 2

1

Because you have multiple installations of PHP on your server, you need to specific which is the default PHP module to be loaded. This can be done via root WHM in Home »Service Configuration »Configure PHP and suEXEC. Select the correct version, and save, and restart Apache.

1
  • Reboot the whole machine to fix the apache, php.ini load glitch. The problem is that Apache and Php gets stuck in memory. So to remedy: Reboot the whole machine and suddenly the new php.ini is loaded. It's sad Linux has to experience the days of Windows Vista through Windows ME where: "Try rebooting the computer" fixes your software problem. Sep 17, 2018 at 20:47
0

looks like you have more then one php, the best thing to do is create a simple phpinfo(); script, see which php.ini it uses and make sure you're editing right php.ini (if file doesn't exist you may want to symlink it to the other one or copy a new one from your source tree).

7
  • I can't use phpinfo() because it is disabled. ;/ I've also removed it from all the php.ini files and restarted apache. Still nothing. I also know for a fact that the php.ini file I am editing is the right one. Oct 26, 2012 at 20:07
  • open your php.ini and look for disable_functions, see if your phpinfo is in there...
    – alexus
    Oct 26, 2012 at 20:11
  • It was. Removed it. Restarted Apache. Still says it is disabled. This is also the correct file. I have also stopped Apache and started directly from apachectl too ;/ Oct 26, 2012 at 20:12
  • can you try placing your .ini file into /usr/local/lib/php.ini.d ?
    – alexus
    Oct 26, 2012 at 20:16
  • Tried that. Looked to have broke everything. When doing a php -v in SSH I got nothing. That was weird? Oct 26, 2012 at 20:20

Not the answer you're looking for? Browse other questions tagged .