php.ini on cpanel

#1
Hello,

I can't find the php.ini

On my php info I get this:

Configuration File (php.ini) Path - /usr/local/lsws/lsphp5/lib

But dear I dont see the php.ini, I only see folder: php with inside this files:
System.php
peclcmd.php
pearcmd.php
PEAR5.php
PEAR.php

and more...

PHP:
oot@db [~]# /usr/local/lsws/fcgi-bin/lsphp5 -i | grep "Configuration File"
Configuration File (php.ini) Path => /usr/local/lsws/lsphp5/lib
Loaded Configuration File => (none)

root@db [~]# /usr/local/lsws/fcgi-bin/lsphp5 -v
PHP 5.4.4 (litespeed) (built: Jul 10 2012 13:43:19)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

root@db [~]# curl -I http://www.xxx.net/php.php
HTTP/1.1 200 OK
Date: Wed, 11 Jul 2012 08:55:06 GMT
Server: LiteSpeed
Connection: close
X-Powered-By: PHP/5.4.4
Content-Type: text/html
I'm use cpanel, how can I edit the php.ini?

Thanks!
 

NiteWave

Administrator
#2
you can create it --- /usr/local/lsws/lsphp5/lib/php.ini

in cPanel, if you build matching php, lsphp5 should use same php.ini -- /usr/local/lib/php.ini
 
#3
I get this error when I add php.ini to /usr/local/lsws/lsphp5/lib/


PHP:
503 Service Unavailable

The server is temporarily busy, try again later!
Do you know why I get this timezone error:?
PHP:
Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
I have this in my php.ini
date.timezone = "Europe/Berlin"
extension=timezonedb.so
 
#5
I stil get this error:
PHP:
503 Service Unavailable
This is my configuration:
PHP:
date.timezone = "Europe/Berlin"

extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
extension=xcache.so
extension=memcache.so
extension=apc.so

zend_extension = "/usr/local/IonCube/ioncube_loader_lin_5.3.so"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.check_mtime="1"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.debug="0"
eaccelerator.enable="1"
eaccelerator.filter=""
eaccelerator.optimizer="1"
eaccelerator.shm_max="0"
eaccelerator.shm_only="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_size="16"
eaccelerator.shm_ttl="0"
 
#7
Still get error:

PHP:
date.timezone = "Europe/Berlin"

extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
extension=apc.so

zend_extension = "/usr/local/IonCube/ioncube_loader_lin_5.3.so"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.check_mtime="1"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.debug="0"
eaccelerator.enable="1"
eaccelerator.filter=""
eaccelerator.optimizer="1"
eaccelerator.shm_max="0"
eaccelerator.shm_only="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_size="16"
eaccelerator.shm_ttl="0"
 

NiteWave

Administrator
#8
do you have
extension=eaccelerator.so
in php.ini ? it's also opcode cache. same advice as before: only keep one.

please list all of your extensions in php.ini if still 503 error.
 
#9
there only two probleem
1.timezone
PHP:
date
Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/xx/public_html/php.php on line 4
date/time support	enabled
"Olson" Timezone Database Version	2012.3
Timezone Database	internal
Default timezone	UTC
2. When I create php.ini here /usr/local/lsws/lsphp5/lib I get this error:
PHP:
03 Service Unavailable

The server is temporarily busy, try again later!


I have change to this configuration but still get error:
PHP:
date.timezone = "Europe/Berlin"
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"
extension=eaccelerator.so
zend_extension = "/usr/local/IonCube/ioncube_loader_lin_5.3.so"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.check_mtime="1"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.debug="0"
eaccelerator.enable="1"
eaccelerator.filter=""
eaccelerator.optimizer="1"
eaccelerator.shm_max="0"
eaccelerator.shm_only="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_size="16"
eaccelerator.shm_ttl="0"
On my extension directory I have this:
xcache.so
apc.so
memcache.so
timezonedb.so
suhosin.so
ixed.5.3.lin
eaccelerator.so
 
#10
please comment out all extensions:
extension=eaccelerator.so
zend_extension = "/usr/local/IonCube/ioncube_loader_lin_5.3.so"

and test again. if no 503 error, then add the extension one by one, to identify which extension is the cause.
 
#11
I have disable all extension only this left:
date.timezone = "Europe/Berlin"

I have test with this and without this:
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20090626"

I have save php.ini and then I test it and it working but when I restart litespeed I get the error.
 
#13
Yes before I dont had probleem, it only hapen when I install litespeed and compile php.

This is my Configure Command for compile php to 5.4.4
PHP:
'./configure' '--prefix=/usr/local/lsws/lsphp5' '--with-mysqli' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--disable-pdo' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-sockets' '--enable-zip' '--with-curl=/opt/curlssl/' '--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-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-pic' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr' '--with-litespeed'
I also have try to change Apache Port Offset to 2080 and 2443 but I get this error:
PHP:
root@db [~]# service httpd start
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
root@db [~]# service httpd status

Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://localhost/whm-server-status
But all my website work fine on litespeed
only that probleem with timezone that I need to fix.
 

webizen

Well-Known Member
#14
looks like litespeed is running on port 80. do 'netstat -tnpl | grep litespeed' to verify.

for the timezone issue. is the php.ini you saved the one in use by lsws? you can do '/usr/local/lsws/fcgi-bin/lsphp5 -i | grep "Configuration File"' to check.
 
Top