Wonder if someone could point me in the right direction.
I am trying to run a script from the command line, the file is located in public_html/xp/script.php
The command I have attemted to use (as per instructions by the script maker) is as follows,
php script.php -run public_html/xp
but get the following message, “Could not open input file: script.php”
I have checked the permissions of this file and that is not the issue. Am I using the right command to find the file?
It appears you are running the command from a directory (folder) other than the location of the script.
In order to run the script you must either a) be in the same directory or b) the directory in which the script lives is in your path.
PHP is [probably] in your path. That is why you can issue the command from a prompt on your server.
Try this
php --run ~/public_html/xp/script.php
*notice the dash dash (two dashes) that are required when you use the full word. It would be a single dash and the letter ‘r’ otherwise
Thanks for the help.
I tried your command and got the following error message, “Parse error: syntax error, unexpected $end in Command line code on line 1”
The directions from the script maker, albeit not very informative, are as follows,
Run the script with a -run flag
php ‘’‘regen-script.php’‘’ -run <system path to ‘’‘regen-script.php folder’‘’>
From the command promt I can get to the folder regen-script.php is in by using cd public_html/xp but once in that folder what command would I use then?
I have given you that answer as part of the explanation in my previous post. Assuming you are IN THE DIRECTORY where the script ‘lives’, simply use the self-reference syntax of DOT SLASH.
This should work (making a few assumptions about the robustness of the script)