0

I have a site with laravel and vuejs. I dont have access to my programmer and this error occur when function takes more than 2 minutes

500 Internal Server Error Request Timeout This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'.

I searched and i found to have change .htaccess my .htaccess was:

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php5_module>
   php_flag asp_tags Off
   php_flag display_errors Off
   php_value max_execution_time 1200
   php_value max_input_time 1200
   php_value max_input_vars 1000
   php_value memory_limit 1024M
   php_value post_max_size 1024M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php56"
   php_value upload_max_filesize 1024M
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_flag asp_tags Off
   php_flag display_errors Off
   php_value max_execution_time 1200
   php_value max_input_time 1200
   php_value max_input_vars 1000
   php_value memory_limit 1024M
   php_value post_max_size 1024M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php56"
   php_value upload_max_filesize 1024M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit

i changed it to:

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule Litespeed>
 RewriteEngine On
 RewriteRule .* - [E=noabort:1, E=noconntimeout:1]
</IfModule>
<IfModule php5_module>
   php_flag asp_tags Off
   php_flag display_errors Off
   php_value max_execution_time 3000
   php_value max_input_time 3000
   php_value max_input_vars 1000
   php_value memory_limit 1024M
   php_value post_max_size 1024M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php56"
   php_value upload_max_filesize 1024M
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_flag asp_tags Off
   php_flag display_errors Off
   php_value max_execution_time 3000
   php_value max_input_time 3000
   php_value max_input_vars 1000
   php_value memory_limit 1024M
   php_value post_max_size 1024M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php56"
   php_value upload_max_filesize 1024M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit

but error is still not fixed. Do I have to do anything else?

  • You probably need to [tune Apache as well](https://stackoverflow.com/questions/45498037/apache-web-server-timeout-after-60-seconds). Though you may need to figure out why it's taking over 2 minutes to run – aynber Mar 06 '23 at 14:51
  • Increasing resources or removing apache restrictions are not good ways to solve it. You probably have a query that consumes all server resources. My recommendation is to hire a programmer. – Luciano Mar 06 '23 at 20:08

1 Answers1

0

You can increase the php max execution time, but that is not a good approach unless is really needed.

Check the

storage/logs/laravel.log

To se what is the actual issue on the code, it might be a time out if that is the case try to see if you can do something in the code to be more efficient, If this is a report that might take long time to execute, you can also consider creating a command.

Vidal
  • 2,605
  • 2
  • 16
  • 32