php4


Table of Contents:


Introduction

Dear Samiuela LV Taufa,
My name is Guillermo Ruiz and I'm writing you from Hayward, California USA. Just recently I came across your website http://nomoa.com/bsd/index.html Buddy, I need to tell you this: It is awesome! I've been looking for so long about setting up web applications using OpenBSD OS but no more search. I think your pages are filled with so much rich and valuable data anywhere else I would find. Keep up the good work!
 
As a token of apreciation, and giving you my most sincere thanks for your help, I would like to share some information about implementing PHP4 with MySQL support. I setup my old and friendly Cyrix 333 Mhz computer with the latest, I mean, the latest versions of OpenBSD(2.8), PHP-with-MySQL-support(4.0.3pl1), and MySQL (Stable 3.22.32)

Configuring

After installing the OS, I setup the Apache web server, I setup the database program, and then installed the PHP package. When the setup finished, a message popped up saying that I had to run /usr/local/sbin/php4-enable command to activate the PHP modules which I did, and it automatically added the LoadModule php4_module line in the httpd.conf file I also tweaked the mime files the way you explained on your web pages, and added the php extensions to the Directory Index. I rebooted the machine, and something funny happened: Apache wasn't loading at all! I tried to load it manually, and the following message came up:

/usr/libexec/ld.so: httpd: libmysqlclient.so.6.0: No such file or directory
/usr/sbin/apache start: httpd could not be started

That same message I saw during the boot process. I did a little research until I found the solution:

Just add

shlib_dirs=/usr/local/lib/mysql

in

File: /etc/rc.conf

so ld.so finds the MySQL libraries.

shlib_dirs is usually empty, but it is already in the rc.conf file. Just add what it is after the equal sign and then Apache will work but now there was another problem: I created a test.php file with the famous phpinfo() function to see if PHP was active, but it wasn't or Apache didn't know what to do with that file! Everytime I pinpointed the test.php file using Lynx or any other browser it tried to download it instead of displaying the php environment. So again I did a little research and I came up with another solution: In the section of the httpd.conf file dealing with "tweaking the mime.types" I modified it this way:

File: /var/www/conf/httpd.conf

AddType application/x-httpd-php .phtml

AddType application/x-httpd-php .php .php3 .php4

AddType application/x-httpd-php-source .phps

And again, it worked! You can, of course, add this information in your web site just in case someone wants to install PHP4 to use it with MySQL. Thanks again, for providing me the most rewarding information available for the OpenBSD OS! I'll keep in touch if I find something interesting.

Sincerely,

Guillermo Ruiz

;-)8

Editorial Notes

The contents of Guillermo Ruiz's original e-mail has remained largely intact. Where changes have been made, they have been to hopefully enhance readability.

You may find it useful to read through my php3 installation guide.

The copyright of the original material remains with Guillermo Ruiz.

Author and Copyright

Layout Copyright (c) 2000 Samiuela LV Taufa. All Rights Reserved.

I reserve the right to be totally incorrect even at the best advice of betters. In other words, I'm probably wrong in enough places for you to call me an idiot, but don't 'cause you'll hurt my sensibilities, just tell me where I went wrong and I'll try again.

You are permitted and encouraged to use this guide for fun or for profit as you see fit. If you republish this work in what-ever form, it would be nice (though not enforceable) to be credited.

 

php4.

Copyright  © 2000 NoMoa Publishers All rights reserved. Caveat Emptor