• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

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

N

Nelson T.

Guest
#1
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

N

Nelson T.

Guest
#8
[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
 

teletubbi

Well-known member
#9
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.
 
N

Nelson T.

Guest
#10
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.
 

MattW

Well-known member
#13
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
 
N

Nelson T.

Guest
#14
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

teletubbi

Well-known member
#17
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.
 
N

Nelson T.

Guest
#20
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?