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.

PHP cli not working for 5.3.3

Discussion in 'General Discussion' started by Mamsaac, Oct 16, 2010.

  1. Mamsaac

    Mamsaac Registered

    Joined:
    Oct 16, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    We have PHP 5.3.3 installed using cPanel WHM on our hosting, but the cli is not working properly.

    When executing the command: "php -a", all output I get is "Interactive mode enabled", but no prompt appears.

    I solved this issue in the past in a RedHat machine (this server is running under CentOS) by compiling PHP but adding the option "--with-readline".

    The phpinfo generated with the compiled PHP doesn't show such option and I couldn't find it in the wizard for recompiling PHP.

    Any ideas? Thanks in advance for the help and for taking your time =)
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    In the following folder:

    Code:
    /var/cpanel/easy/apache/rawopts
    Create a file called all_php5 there and put this into that file:

    Code:
    --with-readline
    Then run /scripts/easyapache --force to recompile Apache. I tested this on my machine and I get the following when entering php -a in root SSH now:

    Code:
    # php -a
    Interactive shell
    
    php >
    Prior to adding that line and recompiling Apache, php -a was not returning a prompt for php >
     
  3. Mamsaac

    Mamsaac Registered

    Joined:
    Oct 16, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Thanks a bunch =) Haven't tried it, but this should be really useful.

    I do think this should be the default on the PHP configuration... after all, who wants the cli if there's no interpreter working?

    Again, thanks.
     
Loading...

Share This Page