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.

Cpanel PHP code checker

Discussion in 'General Discussion' started by walt, Dec 13, 2015.

  1. walt

    walt Member

    Joined:
    Oct 30, 2015
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Houston, Tx
    cPanel Access Level:
    Website Owner
    Hello, I am using cPanel code editor to write php scripts. If there is an error in the file, often there is no error log generated. I was having a difficult time with this, until I found a nice terminal command 'php -l <filename>'. This has caught every error so far.

    However, to use this I have to log into my account using Putty, and if the file has '.inc' extension, it won't show in a directory listing. I have to first change the extension to .php from cPanel.

    Is there something equivalent to 'php -l <filename>' that I could use from cPanel? Maybe an app I could install or turn on?

    Thanks!

    Shared hosting account info:
    Code:
    grep '' /etc/redhat-release /usr/local/cpanel/version /var/cpanel/envtype ; grep CPANEL= /etc/cpupdate.conf ; httpd -v ; php -v ; mysql -V
    
    grep: /etc/redhat-release: No such file or directory
    /usr/local/cpanel/version:11.48.4.8
    /var/cpanel/envtype:standard
    grep: /etc/cpupdate.conf: No such file or directory
    -jailshell: httpd: command not found
    PHP 5.4.45 (cli) (built: Oct  5 2015 15:35:12)
    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
      with the ionCube PHP Loader v4.7.4, Copyright (c) 2002-2014, by ionCube Ltd., and
      with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies
    mysql  Ver 14.14 Distrib 5.5.42-37.1, for Linux (x86_64) using readline 5.1
     
  2. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    865
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Never used putty myself ( I run a linux desktop) but doesn't the normal ls or ls -lah commands work for you?
     
  3. walt

    walt Member

    Joined:
    Oct 30, 2015
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Houston, Tx
    cPanel Access Level:
    Website Owner
    Thanks kernow, ls -lah works. I was using ls -al.

    I read somewhere that, for security reasons, there is a server setting that will not allow certain files to be listed (only remotely?). I did not feel like trying to change this setting, however ls -lah is showing all the files. Great!

    I'm logging in using Windows xp. I do have a small Linux computer that I could try logging in with. Would there be any advantages of logging in with a Linux computer?

    Edit: Just realized that asking a Linux user if there are advantages over Windows is probably an insult! Apologies, didn't mean it that way :)
     
    #3 walt, Dec 13, 2015
    Last edited: Dec 13, 2015
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Do you have root access to the server? If not, you can report this issue to your web hosting provider to see if they can modify the error reporting configuration for PHP.

    Thank you.
     
  5. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    865
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    No insult taken :)
    I stopped using windoze as a desktop about 15 years ago, advantages of using Linux? well let me see, security, stability, reliability..........:)
     
  6. walt

    walt Member

    Joined:
    Oct 30, 2015
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Houston, Tx
    cPanel Access Level:
    Website Owner
    @cPanelMichael, thanks for your reply. I will try and learn a bit about php error logging before I ask them to do anything, just in case this is a 'beware what you ask for' case .

    For now logging in with Putty, and using 'php -l' is working great, thanks to kernow pointing out how to list hidden files with the 'ls -alh' command. Now it occurred to me that access to a terminal window, from cPanel, would be very handy. Could this be added under the 'advanced' tab?

    @kernow
    When xp was phased out, I bought a small single board Linux computer to learn about Linux. It has a 1Ghz dual core A20, 1GB ram and I added a hard dive. If it has a multitasking limit, I have not reached it yet. The processor only has a passive 3/4 x 3/4" heat sink. At 100% load, it's barely warm to the touch. I can't imagine what a modern Linux laptop would be able to do, and it's very tempting to look into it.
     
    #6 walt, Dec 14, 2015
    Last edited: Dec 14, 2015
  7. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    865
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Feel free to vote and add your feedback to the following feature request:

    Include an html5 ssh terminal client

    Thank you.
     
Loading...

Share This Page