Technoracle
    Facebook Twitter Instagram
    • Sitemap
    • Privacy Policy
    • Disclaimer
    • Term of Services
    Facebook Twitter Instagram Pinterest Vimeo
    TechnoracleTechnoracle
    • Tutorials
      • Amazon Cloud
      • Google Cloud
    • How To
    • Blog
    • About
    Subscribe
    Technoracle
    Home»How To»How to Increase Execution Time in PHP
    How To

    How to Increase Execution Time in PHP

    Sulagna MukherjeeBy Sulagna MukherjeeOctober 2, 2022No Comments2 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    increase execution time in PHP
    Share
    Facebook Twitter LinkedIn Pinterest Email

    By default, PHP is allowed to execute under 30 sec in most of the web servers, but it varies. When it reaches the limit, it returns a fatal error “Maximum execution time of 30 seconds exceeded”. Sometimes users may need to upload big chunks of files, or need to send mass emails, wordpress theme uploads, etc. In all cases, the most common error is PHP maximum execution limit crossed. In this tutorial, I am going to share how to increase execution time in PHP. So, let’s get started.

    Page Contents

    • How to Increase Execution Time in PHP
      • Change PHP max_execution_time in cPanel
      • Increase max_execution_time through SSH
    • Conclusion

    How to Increase Execution Time in PHP

    I will share how to fix the PHP maximum_execution_time exceeded issue from cPanel as well as from the command line of any VPS or cloud server.

    Change PHP max_execution_time in cPanel

    To change the maximum execution time limit in cPanel, first go to MultiPHP INI editor under software.

    Multi PHP INI editor in cPanel

    Choose the location where you want to increase the value of maximum execution time.

    choose PHP INI file to edit

    When you selected the location, where the value needs to be updated. A new window will open, now find the max_execution_time and other php directives you want to update the value.

    Now, you can change the PHP maximum execution time value as required. Alternatively, you can update the .htaccess file to increase execution time in PHP.

    To update the php execution time by editing .htaccess, open the htaccess file in cpanel or download the file using FTP. Add the following line at the bottom.

    php_value max_execution_time 300

    Increase max_execution_time through SSH

    If you are using any cloud or VPS hosting, You might have SSH access to the server. In my case, I am using the Ubuntu web server on AWS Lightsail. To update the maximum execution time first, you need to find the PHP INI file on the server. Now edit the PHP INI file using any text editor to change the execution time value.

    $ sudo vi /etc/php/7.4/apache2/php.ini

    After opening the php ini file, search for max_execution_time and edit the corresponding value.

    PHP INI edit via SSH

    Conclusion

    In this tutorial, you have learned how to increase execution time in PHP. If you have any doubts feel free to contact me, I will definitely try to help you. Also, you can join our elite Facebook group to get direct help from me. If you like this tutorial, please share this article on your social media handle.

    cpanel tips max_execution_time increase ubuntu tips
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleTop 5 eLearning Platforms in 2022 [Completely Free]
    Next Article Top 5 Sticky Note Applications for Ubuntu 22.04
    Sulagna Mukherjee

    Sulagna is a tech enthusiastic girl, she is exploring the different fields of technology and sharing her learning through her writings with everyone . You can follow her at YouTube(Noobie Techs)

    Related Posts

    How To

    How to Install Microsoft Teams on Ubuntu 22.04 Easily

    February 22, 2023
    Read More
    How To

    What is Elastic IP and Its Pricing in AWS

    February 22, 2023
    Read More
    How To

    How to Convert PEM to PPK file [Step by Step Guide]

    February 22, 2023
    Read More
    Add A Comment

    Leave A Reply Cancel Reply

    Facebook Twitter Instagram Pinterest
    © 2023 Technoracle

    Type above and press Enter to search. Press Esc to cancel.

    Go to mobile version