Help - Search - Members - Calendar
Full Version: Help With SSH Command
Linuxhelp > In The Community > General Discussion
Photo
Hello,
I wonder if someone could help me, I am trying to run a script from the command line and need a little help. The file is located in the public_html/xp/regen-codebook.php folder of our server, I have tried the following command,

php regen-codebook.php -run public_html/xp

but get the following error, "Could not open input file: regen-codebook.php". I have changed the permissions on the file and that does not help.

Any ideas?
Thanks
michaelk
If your current working directory is not where the file is located or if it isn't in your path environment then you will need to use the entire path in your command statement.
php /public_html/xp/regen-codebook.php -run public_html/xp
Photo
QUOTE (michaelk @ Jun 19 2012, 02:24 PM) *
If your current working directory is not where the file is located or if it isn't in your path environment then you will need to use the entire path in your command statement.
php /public_html/xp/regen-codebook.php -run public_html/xp


Thank you for your help.
I tried the command you posted and received the following message, "Could not open input file: regen-codebook.php"
I can get to the folder that contains regen-codebook.php by using the following command, cd public_html/xp
but not sure which command to use once in that directory.
Here is the instructions from the script creator if that helps.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This script will re-create the codebook contained in the <xp/lib/XPay/Model/Codebook.php> script.

To avoid losing data, do the following before running the script:

Copy the file <xp/lib/XPay/Model/Codebook.php> to the file <xp/lib/XPay/Model/Codebook.prev.php>
Create an X-Payments database dump.
Run the script with a -run flag

php '''regen-codebook.php''' -run <system path to '''xp'''>

If the script failed, copy the file <xp/lib/XPay/Model/Codebook.prev.php> to the file <xp/lib/XPay/Model/Codebook.php>, restore the database from the saved dump and repeat step 3.
If the script completed successfully delete the database dump file and the <lib/XPay/Model/Codebook.prev.php> file.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Thanks again for the help
michaelk
Does regen-codebook.php file have the proper permissions? Are you running the script as root?
Photo
QUOTE (michaelk @ Jun 20 2012, 12:46 PM) *
Does regen-codebook.php file have the proper permissions? Are you running the script as root?


Thank you.

I have tried changing the permissions with no effect, and no I do not have root access to the server.
I have asked our server management company to take a look at this for me so will have to see what they come up with.
I recieved the following reply from the script maker, but upon trying to add full pths I am still not having any luck.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
php '''regen-codebook.php''' -run <'''public_html/xpayments'''

consists of the following parts:

1) "php" - is the PHP binary file. You should use the PHP 5.3. binary with the necessary extensions installed (i.e. so that it meets the X-Payments system requirements). Possibly you'll need to run it with the -c path_to_php.ini_file option.

Contact your hosting to verify which PHP binary and ini file should be used.

2) "regen-codebook.php" is the name of the execuring PHP script. Since only file name is used, it's considered that you've already are in the directory where X-Payments is installed. Otherwise you may use the full server path to this file.

3) "-run" specifies that the regeneration should be preformed.

4) "public_html/xpayments" should be the full server path of the X-Payments directory. You may get it executing the pwd command via shell.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Thanks a lot for trying to help me out with this, I appreciate it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.