Page 1 of 1

Server error 500 after 90 seconds

Posted: Tue Apr 25, 2023 9:23 am
by surus
Hello all,

we have VestaCP with CentOS, httpd and nginx.

We have a large database and now it has grown significantly again and we get an
Error 500 page if a PHP script runs longer than 90 seconds.

We have tried many things to make a PHP script run longer, but we can't get it to work.

We have set max_execution_time to 600 seconds (local via htaccess).
Server timeout connections: 600

Unfortunately I have not found a log file where I can see the reason for error 500.

Therefore I ask for help here.

Re: Server error 500 after 90 seconds

Posted: Fri May 19, 2023 3:52 pm
by johnwood
To troubleshoot the issue, here are some steps you can take:
  1. Check the PHP error log: Look for the PHP error log file on your server. The location of the log file may vary depending on your server configuration. Common locations include `/var/log/php/error.log` or `/var/log/httpd/error_log`. Review the log file for any error messages related to the PHP script execution.
  2. Increase PHP error reporting: In your PHP script or PHP configuration, set the error_reporting value to E_ALL and display_errors to On. This will enable error reporting and display any PHP errors directly on the page. However, remember to turn off the error display in a production environment for security reasons.
  3. Check the web server error log: Look for the error log file for your web server (Apache or nginx). The location of the log file depends on your server setup. For Apache, it may be located at `/var/log/httpd/error_log` or `/var/log/apache2/error.log`. For nginx, it could be at `/var/log/nginx/error.log`wordle unlimited Check the log file for any relevant error messages.
  4. Review resource limits: Ensure that the PHP script is not exceeding any resource limits such as memory_limit or max_input_time. Check your PHP configuration (php.ini) for these settings and adjust them if necessary.
  5. Monitor server resources: Monitor your server's CPU, memory, and disk usage during the execution of the PHP script. A resource bottleneck can cause the script to time out or produce an error. Tools like `top`, `htop`, or system monitoring software can help with this.
  6. Consider optimizing the PHP script: If the script is taking a long time to execute, review its code and consider optimizing it. Look for any inefficient database queries, loops, or operations that can be improved. Caching mechanisms or background processing might be worth exploring as well.
If none of these steps resolve the issue, providing more specific information about your server configuration, PHP version, and any relevant error messages would be helpful in further diagnosing the problem.

Re: Server error 500 after 90 seconds

Posted: Thu Jun 15, 2023 9:39 pm
by desfire
Please, note that vestacp is abandoned and there are huge security issues right now. I'd recommend switching to myvestacp or hestiacp, both vestacp forks. MyVestaCP sticked more to the original vestacp but with more security and hestiacp focused on more features and security as well.