The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cant access php.ini file, is there some cPanel restrictions?

Discussion in 'General Discussion' started by condoace, Feb 28, 2010.

  1. condoace

    condoace Registered

    Joined:
    Feb 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hey,

    I am using PuTTy to get shell access to my *nix system on my own VPS server (not shared). I am trying to edit things in my php.ini, when i do the below commands, my file ONLY shows:

    date.timezone="America/Denver"

    Commands I use: (my php.ini is located at /use/local/lib/php.ini)

    cd /usr/local/lib/php.ini
    cat /usr/local/lib/php.ini

    this appears ONLY
    date.timezone="America/Denver"

    What is happening, i feel there is some restriction on Cpanel or something, has anyone else ecountered this!!! PLEASE HELP!! I have spent like 4 hours trying to solve this!!:eek:
     
  2. ChrisRHS

    ChrisRHS Well-Known Member

    Joined:
    Jul 12, 2006
    Messages:
    292
    Likes Received:
    5
    Trophy Points:
    18
    First, make sure you are the root user. Secondly, the commands you are trying to use to edit the file, are not editors. Do display the whole file in your shell, you would type:

    cat /usr/local/lib/php.ini

    That should show you the entire contents. To edit the file, you need to use an editor, like vi, vim, nano, etc.

    nano /usr/local/lib/php.ini

    I do suggest though, that if you can, use the PHP Config editor through WHM:

    Main >> Service Configuration >> PHP Configuration Editor

    Chris
     
  3. linux7802

    linux7802 Well-Known Member

    Joined:
    Dec 14, 2007
    Messages:
    232
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Solution

    First run command on shell

    [linux@office ~]$ whoami
    root


    If above command give you user name "root" in output then run command and found out correct php.ini file.

    [linux@office ~]$ php -i | grep php.ini
    Configuration File (php.ini) Path => /usr/local/lib
    Loaded Configuration File => /usr/local/lib/php.ini


    The correct path for php.ini file is /usr/local/lib/php.ini then check if any attributes are set for php.ini file or not.

    [linux@office ~]$ lsattr /usr/local/lib/php.ini

    If it gives following outpuout then you will able to edit the php.ini file

    [linux@office ~]$ lsattr /usr/local/lib/php.ini
    ------------- /usr/local/lib/php.ini


    If out comes with the following output then you can't edit php.ini file
    [linux@office ~]$ lsattr /usr/local/lib/php.ini
    -u--ia------- /usr/local/lib/php.ini

    You need to run following command
    [linux@office ~]$chattr -aui /usr/local/lib/php.ini

    and now try to edit the php.ini file as per your requirment :)
     
Loading...

Share This Page