• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Apache gone down after executing script

Nicola

Basic Pleskian
Hi,
I have a function in php that import a dump sql in a database: I'm using this command
PHP:
shell_exec ( "mysqldump -h localhost -u $username -p$password $databaseName | mysql -h localhost -u $username -p$password $databaseName &> /dev/null &" )

If the command run for more then 30 seconds, apache gone away and all sites on the server become inaccessible: I need to restart the php service to restore the functioning.

max_execution_time is set to 300 but nothing changes.

Someone has an idea?

Thanks
 
What sort of related errors do you have in Apache error log?
 
In "error_log" there are no errors, I only can not access via browser (image in attachment). The command is launched via an ajax request
 

Attachments

  • Cattura.JPG
    Cattura.JPG
    24.3 KB · Views: 3
Nginx is not receiving the process result from backend Apache within 30 seconds timeout. See http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout for details on that setting.

To avoid having to reconfigure Nginx for your site, I suggest to change the code of the website and to call the shell_exec command asynchronously, then periodically check on the results. The reason for that is that no setting, whatever you do, will make sure that this error won't occur again. For instance if you set the prox_read_timeout of Nginx to an extremely long time period of 600 seconds (10 minutes) and your dump runs 601 seconds, the error will occur again. You will never know, how long it takes the host to complete the shell_exec command, so you can never be sure whether the timeout occurs.
 
Back
Top