castellano

Apache and PHP woes

Posted on April 18th, 2007 at 12:17am by Pi.
Categories: Development.

I maintain an AMP server in my computer; AMP stands for (A)pache (M)ySQL (P)HP. The most common flavor is actually LAMP (for Linux), where a whole server with basic features is built just with free and open source software. However, I’ve never dared to install and use Linux (yet), so I do it in Windows. However, I’m going away from the point.

After I installed from scratch XP past month, I decided to reinstall the AMP server, in a folder called Cherokee as I’ve been doing in the last years (read Sundiver by David Brin). I installed the last Apache 2.2.4, the last available 4.x version of MySQL (as I don’t want to go 5.x yet) and PHP 4.4.6 (same). I installed and configured everything, as I’ve done several times already, and thought that it was done. The next day I wanted to begin production, so I start AMP… And no way. It doesn’t load. I found the dreaded cannot load error in PHP installations:

httpd.exe: Syntax error on line 188 of C:/Cherokee/Apache2/conf/httpd.conf:
Cannot load C:/Cherokee/php/sapi/php4apache2.dll into server: The specified module could not be found.

This error is quite common when configuring PHP with Apache 2.x; there’s a dll php4ts.dll which must be somewhere in the path. Some people copy it to the sapi folder, or copy the sapi dll to the main PHP folder, or place it in a folder which is in the path. Well, I did ALL of them, yet the hatred error kept appearing. I started making all kinds of combinations of it, changing slashes, moving dll’s, expanding the path, to no avail. I searched internet for this error, and all I could find was the same references to php4ts.dll. I spent almost two hours with this. I surrendered, and decided that there was something inherently wrong in the programs. I think some of you might know that feeling: being sure that you’re doing the correct steps, and the fucktard programs not wanting to work.

I decided to change versions, probably going back from Apache 2.2.4 to 2.0.x (which was the last one I installed, a couple years ago). But before I did so, I searched around looking for specific 2.2.4 - 4.4.6 incompatibilities. PHP.net - nothing. Apache.org - nuts. Google… Oh well, Google is a great tool, but you need to know how to use it. Once I realized how to do the search, I saw that Apache 2.2.x and Apache 2.0.x need modules compiled differently. PHP comes with modules compiled for Apache 1.x and 2.0.x, so one would guess that somehow the developers would notice the need for a module compiled for 2.2.x… The answer is yes and no. PHP 5.x comes with a 2.2.x compiled module, but 4.x NOT. WTF, damn it, joder mierdaputa! There’s a serious compatibility issue, namely PHP 4.x can’t work with Apache 2.2.x, and it’s mentioned NOWHERE. If they decided to not support 2.2.x for the 4.x branch, to encourage people to upgrade to 5.x, it’s fine with me, maybe or even probably I would do the same in such situation. But warn about it! There’s nothing in the installation files about that incompatibility, and certainly I saw nothing in the entire PHP site.

PHP is a great piece of software, built with the efforts of hundreds of individuals over the years, but things like these make people kill people. In the end, you can make two things: download an unnoficial binary of the 4.4.6 PHP module for Apache 2.2.x, and use it instead of the one in the PHP package, or downgrade to Apache 2.0.x, which should be enough for everyone (actually 1.3 is the most recommended+stable+secure version). I downgraded. So thanks, PHP Team, for such a great piece of software, but allow me to hate you for a while over a really stupid silly thing…

And to finish the story with a little bit, I spent 15 minutes in the site of MySQL trying to find a download which didn’t include the buy word, until I realized that I wanted the Community edition. They don’t make it to stand out too much…

6 comments.

JACINTO

Comment on 12:28am.

NO HAY RESPUESTA, PUESTO QUE LA PREGUNTA NO EXISTE EN UN MODO CONSISTENTE.

Pi

Comment on 8:22am.

¿Cuál era la pregunta? No entiendo tu comentario.

GochitaUcevista

Comment on 6:21pm.

Hola estudio Computación y necesito Instalar el Apache HTTP Server 2.2x.
1.Instalar y configurar el Apache HTTP Server 2.2x en el sistema operativo Windows
2. Hacer pruebas de arrancar y detener el Apache HTTP Server.
3. Configurar la instalación de Apache HTTP Server para que en vez de responder por el puerto 80 (estándar) lo haga por el puerto 8888.
4. Configurar la instalación de Apache HTTP Server para que el DocumentRoot sea el directorio c:\\lab\public_html o /home/lab/public_html según sea el sistema operativo de la instalación. Colocar en dicho directorio una página de prueba elaborada por usted: index.html, y verificar que el url http://localhost:8080 muestra la página en cuestión.

Por favor si puedes ayudarme… ;)

Pi

Comment on 6:27pm.

Nunca he instalado Apache HTTPD 2.2, lo siento. Pero seguro que buscando en Google encuentras varios tutoriales. Además, la documentación del HTTPD es bastante buena.

GochitaUcevista

Comment on 6:38pm.

Gracias!!! seguiré buscando en Google!!! :’(

Jose

Comment on 2:19pm.

Bueno, en todo caso es una respuesta, por lo menos a mi me ha servido para poder saber que no estaba haciendo nada mal… Es lo que tiene ser el 1o Pi!!

Por cierto, a mi tb me pasa lo de la web de mysql, que gañanes!!

Leave a comment

Comments can contain some xhtml. Names and emails are required (emails aren't displayed), url's are optional.




Notice »« Ten tons of flax
A fine is a tax for doing wrong. A tax is a fine for doing well.  — Wes Izzard

Pi in the Sky is powered by WordPress. Dressed with Vistered Little. Hosted at MochaHost.