php.ini on cpanel

Discussion in 'PHP' started by flowcubano, Jul 11, 2012.

  1. flowcubano

    flowcubano New Member

    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.iniPath => /usr/local/lsws/lsphp5/lib
    Loaded Configuration File 
    => (none)

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

    root
    @db [~]# curl -I http://www.xxx.net/php.php
    HTTP/1.1 200 OK
    Date
    Wed11 Jul 2012 08:55:06 GMT
    Server
    LiteSpeed
    Connection
    close
    X
    -Powered-ByPHP/5.4.4
    Content
    -Typetext/html

    I'm use cpanel, how can I edit the php.ini?

    Thanks!
  2. NiteWave

    NiteWave Administrator

    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. flowcubano

    flowcubano New Member

    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:
    Warningstrtotime(): 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
  4. NiteWave

    NiteWave Administrator

  5. flowcubano

    flowcubano New Member

    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"
  6. NiteWave

    NiteWave Administrator

    you can't use 2 opcode cache together -- only select one.
    comment out either apc.so or xcache.so
  7. flowcubano

    flowcubano New Member

    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"
  8. NiteWave

    NiteWave Administrator

    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. flowcubano

    flowcubano New Member

    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. NiteWave

    NiteWave Administrator

    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. flowcubano

    flowcubano New Member

    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.
  12. NiteWave

    NiteWave Administrator

    since it's cPanel, does the php script work fine under apache ?
  13. flowcubano

    flowcubano New Member

    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_sockcould 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.

    lynxCan'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.
  14. webizen

    webizen New Member

    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.

Share This Page