You are here:  » Import problem on VPS

Support Forum



Import problem on VPS

Submitted by MikeyC on Wed, 2009-06-03 06:18 in

Hi David,

Last week i changed hosts and finally got me a vps, however i am having trouble with the cronjobs.

When i run fetch.php feeds are getting registered, but not imported.
I ran the command usr/bin/php /var/www/vhosts/mydomain/httpdocs/scrips/import.php @MODIFIED, in SSH and got the following message;

PHP Warning: require(): Unable to access ../includes/common.php in /var/www/vho
sts/mydomain/httpdocs/scripts/import.php on line 4
PHP Warning: require(../includes/common.php): failed to open stream: No such fi
le or directory in /var/www/vhosts/mydomain/httpdocs/scripts/import.php
on line 4
PHP Fatal error: require(): Failed opening required '../includes/common.php' (i
nclude_path='.:') in /var/www/vhosts/mydomain/httpdocs/scripts/import.ph
p on line 4

On line 4 from import.php, the line "required '../includes/common.php' " is in place and also the file itself in includes.

Do you know what the problem is?

Mikey

Submitted by support on Wed, 2009-06-03 07:01

Hello Mikey,

It looks like PHP is not configured to perform an internal cd (change directory) to the same directory as the script. The solution is simply to do the cd in your fetch.sh script, so if you currently have:

/usr/bin/php /var/www/vhosts/mydomain/httpdocs/scripts/import.php

...try this instead:

cd /var/www/vhosts/mydomain/httpdocs/scripts/
/usr/bin/php import.php

That should do the trick!

Cheers,
David.

Submitted by MikeyC on Wed, 2009-06-03 17:25

Hi david,

Yep, that did the trick ! Just ran the command in ssh and it is importing.
Also ran it thru a cronjob on one of my other sites and it worked a treat.
On another is it is working also, but painfully slow.
Guess i'll have to split up the file to take some load of the server.

Thank you David,

Mikey

Submitted by MikeyC on Wed, 2009-06-03 20:54

David,

I got the following message on some feeds while importing

PHP Notice: Undefined index: ADDITIONAL/FIELD@1-VALUE in /var/www/vhosts/mydomain/httpdocs/includes/admin.php on line 175

On other feeds it shows a different ADDITIONAL/FIELD@ -VALUE

Mikey

Submitted by support on Thu, 2009-06-04 07:40

Hi Mikey,

That indicates that your PHP warning levels are turned up to the max; combined with the situation where a field that has been registered does not exist in all records. If despite the notice the feeds are still importing correctly, this can be supressed by adding the following code to the top of common.php - immediately after the opening PHP tag:

  error_reporting(E_ERROR);

Cheers,
David.