Skip navigation.

Syndicate

Syndicate content

User login

php

PHP Sucks

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.

How big is too big for upload_max_filesize?

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.

mod_php on Apache 2, FreeBSD 6.0 doesn't automatically process .php files

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

Can't upload large files to Gallery2

When I upload large files to Gallery (meaning roughly > 2MB) from Gallery Remote I get an upload error. Upon checking @/var/log/httpd-error.log@, I see: bq. @PHP Warning: POST Content-Length of 8503267 bytes exceeds the limit of 8388608 bytes@ In @/usr/local/etc/php.ini@ there's this line:
  ; Maximum size of POST data that PHP will accept.
  post_max_size = 8M
8M 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
Syndicate content