mySQL, PHP, Apache Question
I have httpd 2.0.40 and php4.2.2 installed on RedHat9(an upgrade)
and in the phpinfo there is a note about '--with mysql=shared,/usr' and later in the listing dbx support enabled 1.0.0 MySQL dbx support. And since phpinfo produces output php is ok - but when I try to connect to a database - which is able to be connected to from the shell I get: Fatal error: Call to undefined function: mysql_connect() So I look at phpinfo on my web host and find that there is a section in the phpinfo that lists mysql - but my local host doesn;t have this! So, how do I go about recompiling the php so that it have this proper mysql support and why is it listed as a --with in the configure command if it is not running? I am trying to build a development platform that is a mirror of my hosting server so I can do mods and backups and stuff. TIA *.str |
By using the --with-mysql[=DIR] configuration option you enable PHP to access MySQL databases.
In PHP 4, the option --with-mysql is enabled by default. To disable this default behavior, you may use the --without-mysql configure option. Also in PHP 4, if you enable MySQL without specifying the path to the MySQL install DIR, PHP will use the bundled MySQL client libraries. That s the exact quote from the online php manual, hope it helps |
Why does my host show a table detailing the MySQL configuration but my localhost does not? They both have the same 'configure'.
On my Web Host: mysql MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 3.23.57 MYSQL_MODULE_TYPE external MYSQL_SOCKET /var/lib/mysql/mysql.sock MYSQL_INCLUDE -I/usr/include/mysql MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient This table is missing on my localhost even though "configure command" specifies: with-mysql=shared,/usr' is this an incomplete configuration - where do I need to look to determine if PHP needs recompiling - or will I need to configure httpd somehow differently. Please some pointers to where to look other than the manuals - I have mysql manual and php manual and apache manual and three books for using all three and I am just a bit tangled up since everything is supposedly installed ok and clearly php is running, apache is running and mysql is running/has the database - its just the connection from php/apache to the database. TIA dot* |
Ran into the same problems as you have - I have given up trying to figure things out from the RH9 default binaries.... right now I am opting for compiling everything from scratch first starting with PHP which has given me some trouble because it requires MySQL header files that the binaries dont seem to supply. So I am going to compile and install MySQL too today....
I will watch this thread if ~you happen to stumle on a solution.... If you decide to compile I may be able to help you. PS: please note I am a newbie too... |
Thanks for the post and support Tuka! I will be recompiling once I get time... Just looking around for a bit for clues on how to proceed then I'll post here again!
|
OK I got the lot installed by recompiling the latest sources and making sure that I launched Apache from its new directory. Now I have phpMyAdmin installed I have the dev platform I desired.
Still don't know why the existing rpms didn't support the functions. BTW I had to make clean in PHP to get the -with-mysql fucntion to work - it reported truncated files and I thought I was stuck but make clean fixed the problem - I don't understand - any ideas on why this is necessary - and yes I had done a 'without mysql' configuration prior. Cheers |
May I suggest going to www.hotscripts.com and looking in the php section if you ever need a php/mysql/apache server.
There is a software and servers section that has php/mysql/apache packages for both linux and windows that are one command/click installs. They come with a lot of different stuff, mine was php, mysql, apache2, phpmyadmin, phpnuke, tcl/tk, python, openssl, perl, perl::asp and some other stuff I can't remember offhand. And all it took to install was one command and I had it all installed in seconds. Just had to change a few config files and bingo! You should take a look before going and recompiling all the stuff you need, it may save time (or a thumping headache!). |
All times are GMT -5. The time now is 12:53 PM. |