Suggestion to alter Checklist/DB sticky for DB connection issues
  • 2006/3/25 18:56

  • voite

  • Just popping in

  • Posts: 4

  • Since: 2006/3/23

I recently installed XOOPS on a development box that I set up and configured. It is a windows xp box and like many people on this forum I installed Apache MySQL and PHP myself.

PHP: 5.1.1
MySQL: 5.0.18-nt
xoops: [RECOMMENDED] XOOPS full version

My install got hung up on the database creation for some time and it wasn’t until I realized that though MySQL was installed and could run properly that it was not enabled in PHP that I was able to successfully install Xoops. This whole issue is incredibly frustrating/confusing because the documentation on php5 claims that support for MySQL is built in however that is not entirely true. If there had been even a reminder to ensure that MySQL is enabled with whatever version of PHP one has installed it would have saved me a day of teeth grinding and hair pulling ><

Please consider including the following bit of information somewhere near the top of this forum either in the checklist or in the database connection issue thread:

x) Ensure that MySQL API support for PHP is enabled and working.

1) With error handling turned on run this one line script from your server
<?PHP mysql_connect(address, username, password); ?>

Did you see a blank page or this error message “Call to undefined function mysql_connect()“ If you did your installation of PHP does not yet properly support MySQL.

2)Alternately you can infer the status of MySQL API support by running this one line script from your web server.

<?PHP phpinfo(); ?>

This script will output a large amount of information about the current state of your PHP installation. Specifically we are concerned with a separate section of the output called appropriately enough MySQL. Don’t be alarmed if you do not see this section it just means that as we suspected MySQL API support needs to be installed to PHP and enabled.

Installing and enabling MySQL API support is going to be a little different depending on your versions but if they are anywhere near my version numbers listed above you can try these steps.

3) In your php.ini file edit the extension directory (extension_dir) to point to the full path of the ‘ext’ directory of your php installation. For me this looks like (extension_dir = "c:\php\ext")

4) Next under Dynamic Extensions uncomment the line ‘;extension=php_mysql.dll’ it should now read ‘extension=php_mysql.dll’ Depending on your versions you may have to add this line of code to the php.ini file manually. At this time you should check the ‘ext’ directory of your installation of php to ensure that the .dll does exist on your drive. Depending on what version of PHP you installed you may have to download php_mysql.dll and put it in your ‘ext’ directory.

5) Finally make sure that the directory containing php_mysql.dll is in your PATH environment variable as seen by your web server. Windows users can set this path via the control panel. From the System Properties window click on the advanced tab->Environmental Variables-> Under ‘System Variables’ edit ‘Path’ to include the directory of your PHP installation ‘c:\php’ You will then need to restart your computer. If starting Apache causes an error similar to (unable to load dynamic library 'c:\php\ext\php_mysql.dll') ensure that the .dll exists in the specified directory; the PATH environment variable is properly set; And that you have rebooted since setting the PATH variable. Windows users if you still get an error when starting Apache service you can as a last resort try copying the .dll to your windows/system32 directory.

6) If you successfully launched Apache service with no errors repeat step two and you will most likely now see a MySQL section outputted by the phpinfo() function. You are now ready to install Xoops. If you have tried everything here and MySQL support is still not enabled and you resent the new error you get every time you launch Apache you can go back to step four and comment ‘extension=php_mysql.dll’ to stop the error.

Re: DB connection issues
  • 2006/6/4 3:42

  • Anonymous

  • Posts: 0

  • Since:

An excellent post!

Can this post be 'stickyed'?

Re: DB connection issues

Hi Juliette - can posts like this be transfeerd to xoopsdocs to? - ie - new version of installation manual - installing on local host - link to a DB troubleshoot page..???

Re: Suggestion to alter Checklist/DB sticky for DB connection issues
  • 2006/6/4 22:05

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24

sure it can, but imho you could learn all this from the MySQL & php sites themselves as it is their issue and not xoops.

of course, the people here tend to help, but 1 must assume that if you are installing XOOPS that you have everything setup and working in the 1st place.

if u have a problem with MySQL installation and or php, then would it not be best to get help from there instead? afterall they are the experts on it.. most of those error messages above, a simple search on google would have clearly thrown up solutions on what is causing it.

i think the instructions are clear enough as is, without adding to the complexity of telling you how to install everything that is required (mysql & php). i mean, do we also need to post instructions on how to install & setup Linux or windows too?

when i 1st started with it all, i 1st installed php, so of course (common sense wise) i went to php.net found the site on google. to read up instructions on how to install it.. same with MySQL etc.

Re: Suggestion to alter Checklist/DB sticky for DB connection issues
  • 2006/6/5 2:05

  • rsfeller

  • Just popping in

  • Posts: 20

  • Since: 2006/6/3 1

sounds like good info...but since i'm not a developer or an mySQL/PHP expert most of this means nothing to me!

I couldn't get 4.x or 5.x version of mySQL to work but i went back to 3.x and it did work but i hate the "old school" interface.

Can anyone clairify would most of his references are too? are they changes in PHP or mySQL config?

Re: Suggestion to alter Checklist/DB sticky for DB connection issues
  • 2006/6/5 17:28

  • Anonymous

  • Posts: 0

  • Since:


rsfeller wrote:
[...]Can anyone clairify would most of his references are too? are they changes in PHP or mySQL config?

The post refers to changes to the PHP configuration. For the later versions of PHP there is no default support of MySQL.

Re: Suggestion to alter Checklist/DB sticky for DB connection issues
  • 2006/6/5 21:18

  • astaldaran

  • Just popping in

  • Posts: 73

  • Since: 2004/5/9 1

This was what I had suspected when asking my question about a blank page in this topic

I had already done some of this but then this reminded me that the php.ini is under windows directory; I had not updated that particular copy of the ini.

anymore ideas?

it is still a php-mysql problem and not XOOPS since the phpinfo() does not have a section for mysql. It also turns out when I turned on display_errors it somehow got turned off again but oh well at least I found it. I still get the error Quote:
Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\test.php on line 2
on my test page and a blank on my index.

I am using the latest version (stable) of php and of xoops. Though MySQL is 3.23.54

Re: Suggestion to alter Checklist/DB sticky for DB connection issues
  • 2007/11/24 21:57

  • pron1ck

  • Just popping in

  • Posts: 6

  • Since: 2007/11/24

An excellent post!
oyun oyunlar

Re: Suggestion to alter Checklist/DB sticky for DB connection issues
  • 2008/9/24 3:32

  • Sikandar

  • Just popping in

  • Posts: 99

  • Since: 2005/5/19

I have downloaded latest version 2.3 and trying to setup. On localhost there is no issue but when I uploaded on my hosting site I am entering the IP of my database server instead of name as we normally use the IP but it is not proceeding from Database connection and even not giving any error. Guide me if I am doing anything wrong. Interesting thing is that in old release I provided same info and it had worked.


Who's Online

63 user(s) are online (33 user(s) are browsing Support Forums)

Members: 0

Guests: 63



Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits