Server and Network Monitoring with iPhone
February 25, 2010 – 6:53 pm | No Comment

What is a Unix sysadmin doing with an iPhone, you ask? It was a birthday present, if that’s all right with you. I know, I should have gotten something odd with a beta version of …

Read the full story »
Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands and Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Commands and Shells, Scripts, Web Design

WordPress File Upload Size Limit

Submitted by Igor on December 25, 2009 – 9:24 pmNo Comment
WordPress File Upload Size Limit

By default, WordPress will not allow you to upload a file larger than 2Mb. This limit is not set by WordPress itself, but by detaul PHP configuration. This configuration file is usually /etc/php.ini, but normally your Web hosting provider will not let you modify this file. Below is a possible fix you can try. Before running the commands, edit the path (wpdir variable) for correctly reflect your WordPress installation directory.

#!/bin/ksh
 
wpdir=$(echo "${HOME}/public_html")
 
if [ -f ${wpdir}/php.ini ]
then
	cp -p ${wpdir}/php.ini ${wpdir}/php.ini.`date +'%Y-%m-%d_%H-%M'`
	egrep -v "upload_max_filesize|post_max_size" ${wpdir}/php.ini > ${HOME}/php.tmp
	mv ${HOME}/php.tmp ${wpdir}/php.ini
fi
 
cat >> ${wpdir}/php.ini << EOF
upload_max_filesize = 100M;
post_max_size = 100M;
EOF
 
if [ -f ${wpdir}/wp-admin/php.ini ]
then
	cp -p ${wpdir}/wp-admin/php.ini ${wpdir}/wp-admin/php.ini.`date +'%Y-%m-%d_%H-%M'`
	rm ${wpdir}/wp-admin/php.ini
fi
 
ln -s ${wpdir}/php.ini ${wpdir}/wp-admin/php.ini

This will add two lines to your current php.ini file (or create one, if you don’t have it). This will be an “add-on” php.ini file that will work together with the main php.ini to which you have no access.

Popularity: 3% [?]

Related posts

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.