USB install - MySQL timeout - how to increase?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

USB install - MySQL timeout - how to increase?

Postby Paul_G » 26. March 2011 01:23

I have installed XAMPP on a USB stick as I am building a website for a friend so I want a portable option. The website (opencart) uses a MySQL database. The first step is an install routine that creates the tables in an already created database. The install, that runs just fine on my PC, fails with the following error.

Code: Select all
Fatal error: Maximum execution time of 30 seconds exceeded in J:\xampp\htdocs\oc\install\model\install.php on line 27

I have edited the php.ini in the opencart folder and changed the mysql.connect_timeout = entry from 20 to 60; but that made no difference.

In phpMyAdmin, looking at the Variables tab there are a few time related entries but no way of editing them.

After some digging I looked at config.inc.php where there is only one time related line but I am not sure what it is for.
Code: Select all
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;

Can anyone suggest where I need to make a change to increase the script processing time-out?
Paul_G
 
Posts: 4
Joined: 25. March 2011 23:39

Re: USB install - MySQL timeout - how to increase?

Postby Altrea » 26. March 2011 01:57

Thats the php execution timeout, so take a look into your php.ini file.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: USB install - MySQL timeout - how to increase?

Postby Paul_G » 26. March 2011 17:50

Altrea wrote:Thats the php execution timeout, so take a look into your php.ini file.


I did some Googling and came up with this http://php.net/manual/en/function.set-time-limit.php
I have the XAMPP php.ini and another php.ini in the 'root' folder of the opencart appliction so I made the change there assuming it will overide the XAMPP one when I access file in that folder or below.
The php.ini now contains
Code: Select all
magic_quotes_gpc = Off;
register_globals = Off;
default_charset   = UTF-8;
memory_limit = 64M;
max_execution_time = 36000;
upload_max_filesize = 999M;
safe_mode = Off;
mysql.connect_timeout = 60;
session.use_cookies = On;
session.use_trans_sid = Off;
session.gc_maxlifetime = 12000000;
allow_url_fopen = on;
set_time_limit(60);

I still get the same error.

What am I doing wrong?
Paul_G
 
Posts: 4
Joined: 25. March 2011 23:39

Re: USB install - MySQL timeout - how to increase?

Postby Altrea » 26. March 2011 18:06

You don't know what you are doing there, do you?

Code: Select all
max_execution_time = 36000;

Thats the correct setting to change the execution time. But i don't know if 36000 is a valid value. Try 600. 600 Seconds should be more than enough time for a php script execution.

Code: Select all
upload_max_filesize = 999M;

999 Megabyte upload? You are kidding.

Code: Select all
session.gc_maxlifetime = 12000000;

Not a good idea to set such a hugh value for the garbage collector.

Code: Select all
set_time_limit(60);

Thats completely wrong. Thats a php function and php functions aren't executed in ini files.

After changing the php.ini you have to restart your Apache.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: USB install - MySQL timeout - how to increase?

Postby Paul_G » 26. March 2011 18:33

I never claimed to have a clue. I am just trying to make it work :oops:

All the settings are the original ones in the file supplied with the opencart system APART from the last wrong one that I added.

Would it be possible for you to post the solution you keep hinting at as I obviously am doing it wrong?

Cheers, Paul.
Paul_G
 
Posts: 4
Joined: 25. March 2011 23:39

Re: USB install - MySQL timeout - how to increase?

Postby Sharley » 27. March 2011 01:38

In XAMPP, PHP is compiled as a module of Apache and so the php.ini file is read only once when Apache is started, that's why every time you edit this ini file you must restart Apache.
Here is some reading about the differences between XAMPP's method and the CGI method used by mosts hosting services:
http://www.serverschool.com/dedicated-s ... gi-script/


The php.ini file in the \xampp\php folder is the only php.ini file used by Apache in XAMPP.

You can delete or rename any other php.ini files you find to help prevent conflict.

To confirm which php.ini file is used click on the phpinfo() link in the XAMPP Welcome demo page:
http://localhost/xampp/index.php
or
http://localhost/xampp/phpinfo.php
Look for the Loaded Configuration File entry.

Make sure your edits are in this php.ini file only, save it and then restart Apache each time you make a change - increase the limits by small amounts until you find the settings that best suit your needs based on the hints given by the very experienced forum member Altrea.

You should also consider editing the my.ini file in the \xampp\mysql\bin folder and take a look at performance settings in the \xampp\apache\conf\extra\httpd-default.conf file.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: USB install - MySQL timeout - how to increase?

Postby Paul_G » 27. March 2011 17:48

@Sharley - Thank you for 'sort of' pointing me in the right direction. I now have a better understanding of how XAMPP deals with the PHP set-up. After even more digging I FINALLY managed to get it to work.

For the benefit of any other NooBs also struggling with time-out on a USB stick, here is the solution that worked for me.

1 - Open to edit php.ini file in the \xampp\php folder.
2 - Find "max_execution_time = 30" which is at line 442 in my file.
3 - Increase the value (seconds) until you get rid of the time-out error. In my case I used 90 but monitoring the script showed a completion in 70.

The script I was running was adding 59 tables to an empty SQL database. If your USB stick is faster, you may not need such a high value.

Thanks to those that contributed to this but it does leaves one question - why couldn't someone have posted this solution sooner? Once found it is so obvious.

Paul.
Paul_G
 
Posts: 4
Joined: 25. March 2011 23:39


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 129 guests