Hi,
I tried to run import.php using Putty. It did not do anything. I got this:
> php import.php
X-powered-by: PHP 4.4.7
Content-type: text/html
I have no problem import using Admin page. I have Managed Server with 1and1.
Thank you
Hi David,
I tried
> php import.php @ALL
and
> php import.php myfilename.txt
It still displayed
X-powered-by: PHP 4.4.7
Content-type: text/html
Thank you
Hello,
It looks like PHP might not be configured correctly to run from the command line.
Can you create a test script, with the following code:
test.php
<?php
print "Testing...";
?>
Then, run this in the same way as import.php, e.g.
>php test.php
And check that it displays "Testing...".
Cheers,
David.
Hi,
I loaded and run test.php, it still display
>php test.php
X-Powered-by: PHP/4.4.7
Content-type: text/html
I got Managed Server from 1and1 one week ago. I don't know what they set up and configured on the server.
Thank you
Hi,
This is strange, as it should execute the file by default. What happens if you use the actual switch -f, for example:
>php -f test.php
Cheers,
David.
Hi,
It works when I run
>php -f test.php
Testing...
Hi,
That means that for some reason PHP is not configured to execute the filename by default, you need to specify "-f". Therefore, try:
>php -f import.php @ALL
or
>php -f import.php filename.txt
...and it should work.
Cheers,
David.
I'm switching to a new host and I can't run import from the command line. I tried what you mentioned above but it still didn't work.
Hi,
Incase you hadn't come across it, check out the following thread with recommendations and discussion about hosts and requirements...
http://www.pricetapestry.com/node/173
Cheers,
David.
I have vps hosting with westhost now. I'm setting up my website making sure everything work. When I run php import.php @ALL it doesn't do anything. I don't get an error. I look to see if the feeds are imported and they haven't. My last host I would see the feeds importing on the screen.
When you run the command, is there absolutely no output at all? Does it just return to the command line?
Can you try a test script, that just prints something out, for example:
test.php:
<?php
print "PHP from the command line is working.";
?>
And then try running it in the same way:
php test.php
If that doesn't do anything either, then for some reason PHP is not configured correctly to work from the command line. If you have a VPS account then you should have complete control over the configuration so there shouln't be any policy restrictions preventing you from running scripts in this way...
Cheers,
David.
This is what I get when I run test.php
[megashoppingonline][/]$ /var/www/html/test.php
/var/www/html/test.php: line 1: ?php: No such file or directory
/var/www/html/test.php: line 2: print: command not found
/var/www/html/test.php: line 3: syntax error near unexpected token `newline'
/var/www/html/test.php: line 3: `?> '
[megashoppingonline][/]$
Hi,
You need to run it using the PHP command, just like import.php above, and ideally whenever running PHP scripts like this having changed directory (cd) to the directory of the script, for example:
[megashoppingonline][/]$cd /var/www/html/test.php
[megashoppingonline][/]$php test.php
Cheers,
David.
Can you copy your command line and the output like you posted earlier...
Thanks,
David.
[megashoppingonline][~]$ cd / html
[megashoppingonline][/]$ php test.php
Could not open input file: test.php
[megashoppingonline][/]$
Hi,
The commands you are using to change directory don't look correct - try it exactly like this:
[megashoppingonline][/]$cd /var/www/html/
[megashoppingonline][/]$php test.php
cd / html, which you are currently using will just change directory to / (which you can see in the current path which is displayed in the square brackets)...
Cheers,
David.
Ok this is what i get:
[megashoppingonline][~]$ cd /var/www/html/
[megashoppingonline][/var/www/html]$ php test.php
Failed loading /usr/local/Zend/lib/ZendExtensionManager.so: /usr/local/Zend/lib /ZendExtensionManager.so: cannot open shared object file: No such file or direct ory
Ok I got import.php to work. I have to cd cd /var/www/html/scripts I just cand cd to that directory.
Hi,
This implies that PHP is not configured correctly to run from the command line; or indicates that the installation of PHP when the server was setup (or the VPS configuration) is wrong. I'll have a search on the error message for you and see if anything obvious comes up (although the error message is reasonably self-explanitory), but in the mean time it will be worth copying the same output you posted above to your host's technical support desk as they should be able to see what is wrong from the error and correct the PHP installation...
Cheers,
David.
Hi again,
That's good - not sure why test.php creating the zend message, but if import.php is working you should be OK...
Cheers,
David.
Hi,
When you run import.php, you need to tell it what to import, either a feed filename, or @ALL or @MODIFIED. For example:
>php import.php @ALL
Cheers,
David.