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

  • Thread starter Thread starter Nelson T.
  • Start date Start date
Copy it straight to your home dir and try to run it there.
Doesn't matter if you got errors. It is only to try if you can find it there if you call it.
 
I copied it to "/" which is the home directory for my account.

usr/local/bin/php -f /home/importer.php

and got "No such file or directory"
 
Did you check if anything into this file?
You mentioned filezilla this can sometimes mess up an upload.
 
It's all there:
<snip: code removed as not licensed to share - moderator>
 
Last edited by a moderator:
I assume your /home is not really your home dir.
It is somewhere else.
Do you have MC installed?

This can help you more to find the right place if you are not familiar with Linux commands.
You can browse directory easily. Has also a find option.

As I am in Asia we are in different time zones. Tomorrow I need to get up early that's why I go now offline.

If you can't solve it we can try tomorrow again.
 
No with the code you will get other errors if something wrong with it.
This looks only like not searching at the right place.
 
The web server says they got the SAME result.
The directory is /home.

The web server says it is a problem with the code.
The coder does not wish to help further- says I do not know how to run a SSH CLI.

Thanks for trying to help me- I appreciate it.
 
The server guys should do their home work.

I copied the code onto my server and run it there.
As I aspect it gave me php errors because it was missing files like autoloader.php.
But this is OK because I don't put it on the right place. Just wanna try.

So it is a problem of your server.
 
Can't give you a Screenshot now.
I must say that I don't know how to make it with my tab. But I will post it tomorrow.
 
A memory debugger ran by my web host revealed this:

send(5, "\5\0\0\0\31\3\0\0\0", 9, MSG_DONTWAIT) = 9
send(5, "\204\0\0\0\26\n\t\t\tSELECT title, phrase_te"..., 136, MSG_DONTWAIT) = 136
poll([{fd=5, events=POLLIN|POLLERR|POLLHUP}], 1, 1471228928) = 1 ([{fd=5, revents=POLLIN}])
recv(5, "\f\0\0\1\0\4\0\0\0\2\0\1\0\0\0\0\27\0\0\2\3def\0\0\0\1?\0\f?"..., 129, MSG_DONTWAIT) = 129
poll([{fd=5, events=POLLIN|POLLERR|POLLHUP}], 1, 1471228928) = 1 ([{fd=5, revents=POLLIN}])
recv(5, "title\f?\0d\0\0\0\375\203P\0\0\0g\0\0\5\3def\27hobby"..., 169, MSG_DONTWAIT) = 134
send(5, "\20\0\0\0\27\4\0\0\0\0\1\0\0\0\0\1\375\0\0010", 20, MSG_DONTWAIT) = 20
poll([{fd=5, events=POLLIN|POLLERR|POLLHUP}], 1, 1471228928) = 1 ([{fd=5, revents=POLLIN}])
recv(5, "\1\0\0\1\2[\0\0\2\3def\27hobbymac_xen_forum"..., 35, MSG_DONTWAIT) = 35
poll([{fd=5, events=POLLIN|POLLERR|POLLHUP}], 1, 1471228928) = 1 ([{fd=5, revents=POLLIN}])
recv(5, "in\22xf_phrase_compiled\22xf_phrase_"..., 169, MSG_DONTWAIT) = 169
poll([{fd=5, events=POLLIN|POLLERR|POLLHUP}], 1, 1471228928) = 1 ([{fd=5, revents=POLLIN}])
recv(5, "\0\0\0\5\0\0\4\376\0\0\2\0R\0\0\5\0\0\31unexpected_er"..., 169, MSG_DONTWAIT) = 107
send(5, "\5\0\0\0\32\4\0\0\0", 9, MSG_DONTWAIT) = 9
poll([{fd=5, events=POLLIN|POLLERR|POLLHUP}], 1, 1471228928) = 1 ([{fd=5, revents=POLLIN}])
recv(5, "\7\0\0\1\0\0\0\2\0\0\0", 62, MSG_DONTWAIT) = 11
write(1, "An unexpected error occurred. Pl"..., 53An unexpected error occurred. Please try again later.) = 53

Note the last command.

send(5, "\204\0\0\0\26\n\t\t\tSELECT title, phrase_te"..., 136, MSG_DONTWAIT) = 136

It looks like the sql query generates an error somehow.

I would ask the dev if this helps him diagnose it, but he has refused to help.
 
I copied it to "/" which is the home directory for my account.

usr/local/bin/php -f /home/importer.php

and got "No such file or directory"
Actually... /home is NOT the location of your account home. The location of your account is /home/username/importer.php where the highlighted is the account name you log in under.
 
The location of your account is /home/username/importer.php

Or where ever the host put his home.
As I wrote already I saw where they put it into places like /usr/home/username/ and public_html was only a symlink to /usr/www/users/username/
So for the normal user it looks like this /home/public_html.

He have to figure out what is the right path to his files from root on.
Otherwise he will fail always to call the file with only the path he give till now.
 
Or where ever the host put his home.
As I wrote already I saw where they put it into places like /usr/home/username/ and public_html was only a symlink to /usr/www/users/username/
So for the normal user it looks like this /home/public_html.
Not on any VPS/Dedi I've set up for personal use nor the ProxMox VPS dedicated server I have. /home/username is always where it's located.
Shared hosting is different.
Most hosts (even on a managed VPS/dedi) are NOT going to stray from the default structure layout of a user being in /home.
We are not talking about his actual script related files. Those can be numerous places. On some of my VPS's they are in /var/www/domain structure, in others they are in the /home/nginx/domains/domain.name structure.

Now, all bets are off if you are using (crap)cPanel or one of those other panels... but that's (IMHO) one of the more stupid things to do. Most people go to a VPS/dedi for more resources... and you immediately lose quite a chunk when you install a panel.
 
Maybe not by servers you set up.
I saw this on a managed dedicated server from a big company in my country.

Might be worth a try.
 
Maybe not by servers you set up.
I saw this on a managed dedicated server from a big company in my country.

Might be worth a try.
Odds are it was a cPanel server restricted to using Apache... and that would be normal. I'm used to using a VPS/dedi for the performance gains. Otherwise I'd just go with a quality shared hosting provider).
 
Top Bottom