|
Mini Servers: Introduction | Support | Server 1 - Portable | Server 2 - Service | Server 3 - Portable Authentication | Server 4 - Portable Authen. SSL | Server 5 - SSL Standalone | Browsers dislike self-signed certificates | Server 6 - PHP 5.2.6 Portable | Server 7 - PHP 5.2.6 Service | Server 8 - MySQL Support | Guest Book | Server 9 - Perl 5.2.6 Portable | Server 10 - Perl 5.2.6 Service | Server 11 - MySQL 5.0.67 Portable | Server 12 - MySQL 5.0.67 Service | Server 13 - MySQL 4.1.22 Portable | Server 14 - MySQL 4.1.22 Service | phpMyAdmin - Mini support | MySQL - General problems |
| Mini Servers: Compact fully functional. |
This mini server is based on mini-server 6 its main purpose to show how to enable MySQL server support. Its not difficult and as an added bonus I have included a mini version of phpMyAdmin.
Downloading a working version of this server is the easy option however I trust you will have a go at manually updating server 6 you will learn so much more. I have included detailed information along with some common pitfalls and the type of error messages reported.
I have assumed you have taken the opportunity to downloaded a full version of PHP this allows you to pick up PHP extensions the required.
Note: Check the support files section for server download details.
The server has the following specification:
Enabling MyQL support in PHP is extremely easy uncommenting the appropriate line in php.in and make sure you have the appropriate extension in the extensions folder.
That’s all there is to enabling MySQL, if you require other extensions copy these across and uncomment the appropriate line in php.ini.
Quick test, start the server with luck you will have killed Apache!
I purposefully excluded one crucial step to highlight the problem of either not finding libmysql or finding an incompatible version. Possible errors you will receive will be similar to these:
If you have never installed a program requiring MySQL support libmysql.dll will not be found. You will be greated with this error message when starting the server:
"This application has failed to start because LIBMYSQL.dll was not found. Re-installing the application may fix this problem."
A version of libmysql exists however it is not compatible with the version of PHP currently being used
"The procedure entry point mysql_server_end could not be located in the dynamic link library LIBMYSQL.dll"
The first error is self explanatory libmysql.dll was not installed hence cannot be found.
The second error is a little more interesting Apache has picked up the wrong version of libmysql certainly not clear from that error message. There are two causes for this, libmysql is from an older installation (I used a MySQL4 version) or it is the correct version number but not compiled alongside the existing version of PHP.
Apache searches the system paths (C:\windows and C:\windows\system) and then looks in its own installation folder to find libmysql. It will use the last one found, if you have previously installed any software that uses libmysql and removed that software the chances are libmysql is not removed. If you forget to locate the new version of libmysql in the correct folder say during a manual installation the wrong version will be picked up.
When faced with this problem you first need to choose the correct version of libmysql. There are two possible candidates the one that comes with PHP or the one from MySQL. With luck you will find these are identical if not use the one from the full PHP download.
Where to place it? Do not place it in the system path otherwise you loose portability. You can copy it from PHP to the Apache bin folder and it will be picked up. The only problem with this when upgrading PHP will you remember to copy it across!
My preferred solution is to force Apache to download the binary from the PHP folder.
Add the following line: Loadfile "/usr/local/php/libmysql.dll" to the end of the module list as shown below:
| httpd.conf located in folder: *\udrive\usr\local\apache2\conf | Comments |
|---|---|
|
# ================================================== |
LoadModule php5_module: Module required to handle PHP5 pages. Note: The order is important Loadfile occurs before LoadModule php5_module |
If you have not already done so copy the file libmsql.dll from the full download to folder PHP.
Quick test, start server and check the server error_log file contains no errors.
I thought it worth detailing the above because libmysql has caused numerous problems in the past. Before looking at the support section I would like to introduce PHP Mini SQL Admin
On Source Forge I discovered an interesting little project PHP Mini SQL Admin by Oleg Savchuk because of its small size makes an Ideal companion for the mini-server series.
I have included this in the download it is easy to use and very small, a single page weighing in at 23K.
|
Image to the right shows PHP Mini SQL Admin's login in page.
|
It may have a small footprint however it supports some very powerful features:
It is a versatile script allowing you to explore and beak a few mini-servers. Like Uniform Server if you break one delete it and install a fresh copy and start again.
Each mini server is complete and zipped into a single self-extracting archive file.
Download this server from SourceForge Project Page save the file mini_server_8.exe to any folder of your choice.
Note: Check out the mini server's support and download page detailing how to obtain full binaries for Apache and PHP.
Double click on mini_server_8.exe, starts the extraction process.
No need to change the folder destination, click extract, this creates a new folder mini_server_8 containing the following:
|
Testing is straight forward.
Test 1:
Test 2:
Open the folder www located in folder *mini_server_8\udrive\www (Note * is the path to the folder you extracted the server files) delete everything in www and copy your site into it.
Note: Make sure one of your pages in folder www is named index.html, index.htm or index.php, otherwise you will need to type a page name in every time to access your site.
e.g. http://localhost:8086/somepage.html
The server automatically detects the first free drive letter and uses that to run the server on. You can override this in one of two ways:
This moves the server to the standard secondary web server port
Note: Type http://localhost:8080 into a browser to view the site.
If port already in use try any value above 2000
If you wish to run several mini servers at the same time create a new folder for each server and copy contents of mini server 8 into each of these.
Change the server port for each server to be unique. The servers may be started in any order.
Note: You can run the mini servers alongside Uniform Server 3.5-Apollo however you must start Uniform Server first.
I have covered how to enable MySQL support this along with PHP allows you to access a MySQL server and produce dynamic web sites. Learning SQL phpMiniAdmin provides a very neat clean interface.
Apache with PHP makes for a very powerful dynamic page server, if you prefer to explore using Perl the next mini server has this covered.
| | Ric |
Categories: UniCenter | Mini Servers | PHP | MySQL | Oily Rag | Self Install