My work on a tool to migrate Drupal content to Wordpress’ eXtended RSS (‘WXR) led me into some dusty corners of the WordPress codebase, and I’ve been meaning to write a grumpy post about how much I hate PHP (in which Wordpress is written), but Jeff Atwood at Coding Horror beat me to it with his own PHP sucks lament. Like me, Jeff wonders at the success of PHP given what a dreadfully sucky software engineering tool it is, and scratches his head at the many major Internet properties (Wikipedia, Digg, and Wordpress among them) which are successful notwithstanding an implementation in a language a VB6 programmer might reasonable call “shit”.
Interestingly, though, Jeff and I arrived at two different conclusions on the matter. Jeff surmises:
Some of the largest sites on the internet — sites you probably interact with on a daily basis — are written in PHP.
I recently kicked up the upload_max_filesize parameter to 16MB so I could upload big 7MP images. However, now I’ve taken to shooting incriminating video with my Z750, which gets into the hundreds of megabytes. So, how big is too big? I’m going to try 500MB.
In /usr/local/etc/php.ini:
; Maximum allowed size for uploaded files.
upload_max_filesize = 512M
Let’s see what happens…
UPDATE: Nothing happened. The latest beta of Gallery Remote seems to not care for enormous video files; it just hangs at ‘Preparing to upload…’ indefinitely.
I just installed the apache2 and php5 ports on aenea, and found that accessing .php files via Apache returned the PHP source code, instead of running the PHP server-side.
I had to add the following entries into /usr/local/etc/apache2/httpd.conf in order to get mod_php to pick up the files:
#Register PHP mime types
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
That worked, but index.php wasn’t run automatically if I navigate to a directory. For that I added index.php to the end of the DirectoryIndex directive:
DirectoryIndex index.html index.html.var index.php
; Maximum size of POST data that PHP will accept. post_max_size = 8M8M seems plenty, but apparently there's a helluva lot of overhead associated with uploading an image. I'll double it, to 16M:
; Maximum size of POST data that PHP will accept. post_max_size = 16M