DiigIT | IT Community
No Profile Image
Welcome Guest
New User? Register | Login

When I run my script I receive a "timeout" error

By: rekha singh | 13 Mar 2010 1:28 pm

Hi all

I have PHP, MYSQL, Apache and Dreamweaver installed on my laptop, which is running Windows 7.

Currently I have two problems:

1) I'm developing a program to access a database I'm developing. When I run my script I receive a "timeout" error. It states that my script has exceeded the 30 second time limit. I've edited the php.ini file and changed it from 30 to 600 (granted 10 minutes may be excessive but I wanted to see how long my script will run). I still receive the 30 second warning. So I'm wondering where else might I need to change this limit? I have a work around for this right now but would like it to work the way I want it.

2) My other problem is when I try to run a script using MYSQL in Firefox I receive "Fatal error: Class 'mysqli' not found in C:\htdocs\results. php on line 26". I'm using a script from a book I purchase on PHP and MYSQL so I'm assuming it should work. I've added the mysql system variable as stated in Duane instructions but it still doesn't work. I can bring up the MYSQL command QUI and enter all the commands I want to use but I can't get it to work in Dreamweaver or Firefox or IE. The line is: $db = new mysqli ('localhost' , 'bookorama', 'bookorama123' , 'books');

Any suggestions on what I'm doing wrong? All help would be appreciated.

Thanks

Comments

Make sure libmysql.dll has both read and execute permissions for the user you are using in Windows 7 (assuming it is similar to previous versions of Windows, I haven't used it). I have heard reports of this happening when libmysql.dll has had read only permissions set. Dreamweaver should not make
any difference in your code. Dreamweaver is just a tool to help write the code.

Changing the timeout shouldn't fix your problem unless you are running a huge quantity of data. I have processed over 100,000 lines of text from five files across the internet in a little over 3 minutes. It seems to me if you are processing less than 10,000 lines (or the equivalent) you should
not need to change your timeout. When I get timeout errors I will add print statements throughout my script to help determine where it is hanging up or going into a loop. I start with the most obvious places it would hang up or loop and add a print statement or two. If that doesn't reveal the problem I
will add a couple in the next most logical place until I locate the problem. Once your code is working delete the print statements.

I hope this helps.

By: rekha singh | 13 Mar 2010

Hi

1) In an .htaccess file in the same directry as the executing script, include this line:

php_value max_execution_ time 3600

2) Add or uncomment this line in to your PHP.ini:

extension=php_ mysqli.dll

By: rekha singh | 13 Mar 2010

My timeout problem went away when I changed it in the php.ini file to 240 seconds. Don't know why it didn't work when I changed it to 600.

The mysqli problem went away when I changed it to the one recommended on the internet. Haven't really looked into the differences but I shouldn't have "assumed" the one in the book worked.

Thanks again

By: rekha singh | 13 Mar 2010

Leave a comment

Enter the text in the image
img
Can't read?
Type the characters you see in the picture below.


Close Move