Trying to run SSH CLI PHP Script- Get "Unexpected Error Occurred"

  • Thread starter Thread starter Nelson T.
  • Start date Start date
N

Nelson T.

Guest
I am trying to run a script in PHP using the SSH CLI.

I get the error "Unexpected error occurred. Please try again later".

Coder says something is wrong with my SSH CLI.

Any ideas what is wrong and how to fix it?

TIA.
 

Attachments

  • error.gif
    error.gif
    30.5 KB · Views: 28
Tried:

php -f /path/to/file.php

and got the same error

 

Attachments

  • error2.gif
    error2.gif
    26.8 KB · Views: 22
[Thu May 07 07:35:27 2015] [error] [client 207.46.13.13] File does not exist: /home/hobbymac/public_html/404.shtml
[Thu May 07 07:35:27 2015] [error] [client 207.46.13.13] File does not exist: /home/hobbymac/public_html/find-new
[Thu May 07 07:35:25 2015] [error] [client 208.68.190.28] File does not exist: /home/hobbymac/public_html/404.shtml, referer: http://www.hobby-machinist.com/
[Thu May 07 07:35:25 2015] [error] [client 208.68.190.28] File does not exist: /home/hobbymac/public_html/taigachat, referer: http://www.hobby-machinist.com/
[Thu May 07 07:35:25 2015] [error] [client 188.165.15.50] File does not exist: /home/hobbymac/public_html/404.shtml
[Thu May 07 07:35:25 2015] [error] [client 188.165.15.50] File does not exist: /home/hobbymac/public_html/members
[Thu May 07 07:35:23 2015] [error] [client 157.55.39.155] File does not exist: /home/hobbymac/public_html/404.shtml
[Thu May 07 07:35:23 2015] [error] [client 157.55.39.155] File does not exist: /home/hobbymac/public_html/find-new
[Thu May 07 07:35:23 2015] [error] [client 157.55.39.155] File does not exist: /home/hobbymac/public_html/404.shtml
[Thu May 07 07:35:23 2015] [error] [client 157.55.39.155] File does not exist: /home/hobbymac/public_html/find-new
[Thu May 07 07:35:22 2015] [error] [client 157.55.39.155] File does not exist: /home/hobbymac/public_html/404.shtml
[Thu May 07 07:35:22 2015] [error] [client 157.55.39.155] File does not exist: /home/hobbymac/public_html/attachments
[Thu May 07 07:35:21 2015] [error] [client 144.76.137.226] File does not exist: /home/hobbymac/public_html/404.shtml
[Thu May 07 07:35:21 2015] [error] [client 144.76.137.226] File does not exist: /home/hobbymac/public_html/misc
[Thu May 07 07:35:16 2015] [error] [client 207.46.13.47] File does not exist: /home/hobbymac/public_html/404.shtml
[Thu May 07 07:35:16 2015] [error] [client 207.46.13.47] File does not exist: /home/hobbymac/public_html/find-new
[Thu May 07 07:35:16 2015] [error] [client 148.251.183.105] File does not exist: /home/hobbymac/public_html/404.shtml
[Thu May 07 07:35:16 2015] [error] [client 148.251.183.105] File does not exist: /home/hobbymac/public_html/misc
[Thu May 07 07:35:15 2015] [error] [client 66.249.64.164] File does not exist: /home/hobbymac/public_html/404.shtml
[Thu May 07 07:35:15 2015] [error] [client 66.249.64.164] File does not exist: /home/hobbymac/public_html/Xen
[Thu May 07 07:35:15 2015] [error] [client 212.224.119.142] File does not exist: /home/hobbymac/public_html/404.shtml
[Thu May 07 07:35:15 2015] [error] [client 212.224.119.142] File does not exist: /home/hobbymac/public_html/threads
[Thu May 07 07:35:12 2015] [error] [client 157.55.39.155] File does not exist: /home/hobbymac/public_html/404.shtml
[Thu May 07 07:35:12 2015] [error] [client 157.55.39.155] File does not exist: /home/hobbymac/public_html/attachments
 
This belongs to your Web server.
Has nothing to do with this issue.

I don't know your installation so don't know if php is setup to generate his own log file or report to syslog.
 
How would I obtain the SSH error log. The server is set up:


The operating system is 'CentOS release 6.6'.
This is the output of the command using no php.ini:

root@host [/home/hobbymac]# /usr/bin/php -n /home/hobbymac/public_html/importer.php
Status: 500 Internal Server Error
X-Powered-By: PHP/5.4.39
Content-Type: text/html; charset=utf-8

This is giving back a 500 error.

The web host tried running a script to fix permissions for SuPHP and moved the .htaccess out of the way

I get the same error.
 
A 500 error is generic and say nothing at all.
Maybe a permission issue.

As you say your host, you log in as root?
 
type "which php" and find the absolute path of PHP. As you aren't root, you user may not know where the PHP executable file is. Then, try again with the full path to PHP before the file
 
the path for php is:

usr/local/bin/php

so I used usr/local/bin/php /home/hobbymac/public_html/importer.php

and got the same error.
 

Attachments

  • error3.gif
    error3.gif
    39.9 KB · Views: 19
Than is something wrong with your path.
Some host put the user in /usr/home/www/users or something like that and put only a symlink into your home dir.

You have to find the original path to that file.
 
It says

'importer.php' No such file or directory when in fact (I checked with Filezilla) it appears in the public/html directory.

What is going wrong?
 
Top Bottom