Support forum login

©2006-2008 IAAI Software

Contact Us

Handling Import Timeouts

Submitted by dmorison on Wed, 2006-10-18 10:41.

Some web hosting companies / dedicated servers, by way of their default PHP and/or Apache configuration, impose restrictions on the amount of time that a PHP script is allowed to run for. This is to protect their servers from erroneous scripts that may be consuming ever increasing resources and therefore impacting on the performance of the server.

If this limitation exists it is normally set to around 30 seconds. If the limit is reached during an import you may see a PHP error message (Maximum execution time exceeded) if it is a PHP imposed limit; or the connection may simply be dropped resulting in an error message displayed by your browser (A connection with the server could not be established) if it is a web server imposed limit.

PHP Imposed Timeout

Normally, this will involve a call to the support desk of your hosting company. Explain to them that you are running a script that is processing a large file and that you would like to have the time limit removed on your account. In most cases, your host will remove the limit in order to keep your business. However, before contacting your host you can try adding the following statement to a .htaccess file in the top level directory of your website:

php_value max_execution_time 0

Web Server Imposed Timeout

If the timeout results in a server error or page failing to load you may be able to import large feeds using the automation scripts as these are not accessed via the web server. To access the automation scripts you will need to be able to login to your hosting account via Telnet or SSH and have the ability to execute commands. A popular SSH client for Windows is Putty, which you can download from here:

http://www.chiark.greenend.org.uk/~sgtatham/putty/

If you do not know if you have SSH access to your account it is worth just trying it anyway - open Putty and choose SSH as the connection type. Then enter exactly the same details (hostname, username and password) as you would use to access the FTP server for your hosting account. If you get a connection, you will be presented with a command prompt ($) and can start entering commands. The commands to use the Price Tapestry automation scripts are as follows:

$cd path/to/pricetapestry/scripts
$php import.php <filename>

Where <filename> is the filename that you have already registered using the administration interface.

As a final note; it is always worth using XML feeds in preference to text file versions if both are available as they are much faster. In general, almost all hosting accounts can import up to 10,000 products from an XML feed within 30 seconds.

See also:

Recommended Hosts

Submitted by Oisin on Fri, 2006-10-27 06:35.

hi david,

i browsed to the location of the import.php and tried this command

$php import.php filenameofthedatabase.csv

and i get this error

-jailshell: import.php: command not found

i am trying to load a 50k products database.

any problems?

i also made the PHP max exec time to 60 minutes still cant load the full database.

regards,

Submitted by dmorison on Fri, 2006-10-27 07:55.

Hi Oisin,

I'm slightly confused by that error message as import.php is not the command that you are running - it is "php". What happens if you just run PHP on its own as follows:

$php

If that works (in which case you'll need to press CTRL-C to exit), try PHP with a switch, for example -v to display the version:

$php -v

Assuming that's OK - try the command again without a filename:

$php import.php

I'm not sure how far this will get you as I really don't understand the behaviour of jailshell as you have described it. It would help to contact your hosting company in this instance and show them the command line that you are using and ask why jailshell is not interpreting it in the same way as a normal shell.

Hope this helps,
Cheers,
David.

Submitted by Oisin on Fri, 2006-10-27 09:38.

sorry for being such a neub! :)

i tried the command
$php import.php

and got this error
-bash: import.php: command not found

i removed the $ before the php and added the import filename and voila! its now parsing :)

php import.php filename.csv

its now importing filename.csv... [3000/0]

thanks. :)