chiprivers Posted March 24, 2010 Share Posted March 24, 2010 I have got IIS running on my laptop with PHP and MySQL so that I can test my scripts locally. I am currently working on a small project and I am half way through coding quite a hefty page but it is running really slowly. It can take around 20 seconds to load and I have still got quite a bit of coding to do on this same script. Just wondering if there is anything I can do to speed up the PHP on my server before I look at an alternative coding approach to get it running faster? Quote Link to comment Share on other sites More sharing options...
paparts Posted May 27, 2010 Share Posted May 27, 2010 Try restarting your webserver. Quote Link to comment Share on other sites More sharing options...
VinnyCP Posted May 28, 2010 Share Posted May 28, 2010 Dude, in these scripts, do you use the database? There can be also two things you can do with your scripts to make them faster, and that could be the problem also. Always when you have a condition, and that condition ends the page, try the exit() function or exit(0) (http://br.php.net/manual/en/function.exit.php). When you do that, the script just stops. It saves a lot of work to the server, 'cause it will still read all the code, even if it doesn't have to. And another function you can try is mysql_close() (http://br.php.net/manual/en/function.mysql-close.php). That's really useful, 'cause if you connect to the DB during scripting, and you finish the script, the DB connection will be still running! Then if you finished using the connection to the base, close it. The problem can also be these two things. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.