I've been trying to migrate my webblogs using WordPress inbuilt import facility. I've exported current blog as a xml file and downloaded to my desktop. Next I navigated to my new blog's admin area and clicked on Manage > Import. However import failed after importing 50-60% posts only.
I went through Apache and PHP log files and I realized that the script was timed out. How do I fix this problem under Linux / UNIX?
PHP by default places resource limits on all php scripts using the following three directives:
=> max_execution_time : Maximum execution time of each script, in seconds (default 30 seconds)
=> max_input_time : Maximum amount of time each script may spend parsing request data (60 seconds)
=> memory_limit : Maximum amount of memory a script may consume (default 8MB)
Your php script was timed out because of resource limits. All you need to do is setup a new resource limits so that the script will get executed:
Open /etc/php.ini (or /etc/php5/php.ini) file:
# vi /etc/php.ini
Locate and setup new resource limits as follows:
# 600 seconds max_execution_time = 600 # 120 seconds max_input_time = 120 # 64 MB memory_limit = 64M
Restart Apache or lighttpd web server:
# /etc/init.d/httpd restart
OR
# /etc/init.d/lighttpd restart
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 3 comments… read them below or add one }
php.ini was in /etc/php5/apache2 for me and the apache2 restart is done by:
/etc/init.d/apache restart
which might help others with Ubuntu. Thanks for the tip.
I surely find this article is useful to me. The script does work!!
Thanks.
Aji
My php script always stopped after 10-14 hours :(