I use on my website codeigniter, at peak times the server is very slow. The administrator reported that the problem comes from my index.php, but index.php would be my route from codeigniter, so the problem is elsewhere in the script. it said the problem is the 'PHP' and not 'mysql', I would like you to help us then to find what might be causing this problem could be a loop? there is some code that you put above and below my codes to see the total execution time?
The problem is that you're using a framework. If you don't want unnecessary PHP slowing your server you should learn PHP and create what you need yourself. Too many people jumping into frameworks without basic programming knowledge, it's depressing to read..
To find the total execution time, you can use the following code: $started_at = microtime(true); // place this at the top in your index.php // all code here // place this at the end of index.php $ended_at = microtime(true); $time_taken = $ended_at - $started_at; //Uncomment the below line to output the total time taken to load the page. //echo 'Script execution time was '.$time_taken.' seconds'; PHP: