Page 1 of 3 123 LastLast
Results 1 to 15 of 31
  1. #1
    Join Date
    Feb 2004
    Posts
    533

    Unanswered: PHP5 MySQL Config on XP

    I just installed Apache/PHP5/MySQL on my Windows PC with XP Home OS. I followed the Tut Installing PHP under Windows by Matthew Phillips Referred to in the Post: Easy to understand Apache/PHP/MySQL install on XP box

    This worked OK aside from a couple obvious differences. I had the most troube getting MySQL configured with PHP and had to do some searching to find the answer. Here is what I had to do to get it working.

    In the Apache httpd.conf File at 'C:\Program Files\Apache Group\Apache2\conf\httpd.conf' You have to add these lines for PHP5

    LoadModule php5_module php5apache2.dll
    AddType application/x-httpd-php .php


    In addition to installing MySQL etc. I had to do this to get MySQL to work:

    1. Make sure that you have a valid php.ini in your windows directory.
    OR (Per the tut the 'php.ini' can be installed in the 'C:\Program Files\Apache Group\Apache2' folder. This works fine.)
    2. copy libmysql.dll to the system32 directory (php_mysql.dll would not load without doing this)
    3. set the extension_dir in php.ini to the ext directory of your PHP installation directory (like e.g. extension_dir=C:\php5\ext)
    4. enable the MySQL extension in php.ini by uncommenting the line extension=php_mysql.dll
    5. Restart Apache Server


    .
    ~

    Bill

  2. #2
    Join Date
    Jan 2004
    Location
    India
    Posts
    168
    Hey Bill that's a good information you have provided. In PHP5 mysql support you have to manualy configure. This would be helpfull for newbies.

    Regards
    Rajesh
    Freelance and Technology Consultant
    -------------------
    Dreams are for ever
    -------------------

  3. #3
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    This is now a sticky...

  4. #4
    Join Date
    Oct 2004
    Posts
    1
    Technophobes : Try
    www.xampp.de
    Click the British flag for English language.
    This software gracefully installs recent versions of PHP5, Apache 2 and MySQL (with admin tools e.g. phpMyAdmin + much more) under Windows XP.
    The only thing to be careful of is that you follow the instructions for configuring your firewall (which would otherwise block Apache and MySQL of course), remembering that MySQL uses an unusual port number (3306).

  5. #5
    Join Date
    Nov 2004
    Posts
    1
    Hello Ive recently installed Apache 2, PHP 5.02 and MYSQL 4.1 on Windows XP.

    I am now tyring to connect to a database called bloomdb i have created in comman prompt mySQL.

    I used an included script for security reasons. Here are the two pages (db_config.php and temp_con.php)

    DB_CONFIG

    <?php
    $db_host = "localhost";
    $db_user = "root";
    $db_password = "password i used whe installing and connecting to MYSQL in command prompt";
    $db_name = "bloomdb";
    ?>

    TEMP_CON.PHP

    <?php
    require($_SERVER["DOCUMENT_ROOT"]."/config/db_config.php");

    $connection = mysql_connect($db_name, $db_user, $db_password) or die("Error - Cannot connect to MYSQL Database");
    echo "Connected Successfully";
    ?>

    The error i get is: Call to undefined function mysql_connect() on line 4 of temp_con.

    Now i have searched the net for this problem and found it is that mysql is not enabled?. Not with PHP 5 by default, I think i have done what you said in this guide correctly but not too sure.

    When you say uncomment what does that mean?, can any of you nice people explain how to enable it in very SIMPLE SIMPLE terms please.

    Huge thanks in advance.

    Chris

  6. #6
    Join Date
    Feb 2004
    Posts
    533
    Quote Originally Posted by bloom
    Hello Ive recently installed Apache 2, PHP 5.02 and MYSQL 4.1 on Windows XP.

    I am now tyring to connect to a database called bloomdb i have created in comman prompt mySQL.

    The error i get is: Call to undefined function mysql_connect() on line 4 of temp_con.

    Now i have searched the net for this problem and found it is that mysql is not enabled?. Not with PHP 5 by default, I think i have done what you said in this guide correctly but not too sure.

    When you say uncomment what does that mean?, can any of you nice people explain how to enable it in very SIMPLE SIMPLE terms please.
    1. check the setup process again follow the steps and notes I've written.
    Part of the process tells you to copy files from the PHP setup folder, where you installed PHP to the 'Program Files/Apache Group/Apache2/' folder.

    One of these files is the PHP.ini file. Open the PHP.ini file in a plain text editor (like 'Note Pad') search or find the line "extension=php_mysql.dll" If there's a ';' semi-colon in front of this line it means it's commented and has no effect of the php settings. Remove the ';' from the line and it is 'uncommneted'. Changes in the PHP.ini have no effect until the Apache server is 'bounced' or restarted. Use the Apache tray icon 'Restart' command for this.

    to check your settings copy this code into a file save it as 'test.php' in your htdocs folder ./apache/htdocs/test.php Then open the file in the browser 'http://loacalhost/test.php' to check your PHP settings.

    PHP Code:
    <?php
     
    echo 'PHP is working.<br>';
     echo 
    phpinfo();
    ?>
    .
    ~

    Bill

  7. #7
    Join Date
    Jan 2005
    Posts
    1

    Thanks

    THANX
    PHP 5 and apache and MySQL on windows XP

    I already had apache and php working but had problems with mysql
    Just registered to say it worked for me

  8. #8
    Join Date
    Jan 2005
    Posts
    1

    Problems

    Hi there


    I am currently experiencing the same problems whereby the mysql_connect( ) function is being treated as an undefined function.

    I have followed all of the steps recommended by you but I am getting the following error when I try to restart the Apache server:


    Syntax error on line 192 of the httpd.conf file:
    cannot load C:/Program Files/Apache group/Apache2/php5apache2.dll into server. The specified module could not be found

    I have a copy of this .dll file not only in that folder but also in the Windows and System32 folder and anywhere else that I think it may be read from but the error persists

    If you have any ideas i would be really grateful as I have a Masters project due in a week and am so frustrated that the application is now not working,

    Thanks in advance,

    Orla

  9. #9
    Join Date
    Feb 2005
    Posts
    4
    i followed the instructions and found them to be very helpfull.

    i needed to one more step though because it gave me the following error:

    Client does not support authentication protocol requested
    by server; consider upgrading MySQL client

    i looked it up on google and found this link: <a href=http://dev.mysql.com/doc/mysql/en/old-client.html>link</a>

    basically it says that the new version of mysql uses a new type of password. i went into the command prompt and changed my account's password using the command they suggest: mysql> SET PASSWORD FOR
    -> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

    this fixed the problem for the mysqli functions, but its weird because i'm using php 5.0.0 and shouldn't it be compatable? the mysql version i'm using is 4.1.9

    the weird thing is though i've got all the mysqli functions working, but the regular mysql ones don't seem to work. also, i've been trying to get the PEAR ones to work too. i ran that go-pear thing, accepted all the defaults and ran the thing thats supposed to put stuff in the registry. is there anything else i gotta do? i thought i saw something about adding something to the path in environmental variables. what would i have to add?

    so my problems are the regular mysql functions don't work, and i'm not sure if i have to do anything else to get the PEAR database stuff working
    Last edited by ctaclas; 02-07-05 at 15:43.

  10. #10
    Join Date
    Feb 2005
    Posts
    1
    Hi everybody,
    I followed the Tut Installing PHP under Windows by Matthew Phillips,installed Apache server on windows xp,PHP and MySQl,i tested apache it is working,also wrote test.php file and everything went fine,messagle PHP is working and lot information,but the problem is i can see all this ony through another computer,i mean when i try localhost i get message connection was refused....
    I am using netgear router, i configure port forwarding for apache and MySQL ports, i even try to turn it off,but still can not access my page through localhostWhen i try this through my friend computer everything is fine??

  11. #11
    Join Date
    Feb 2005
    Posts
    4
    i'm a total n00b when it comes to this stuff, but maybe it's something with the mysql account. i think when you create it you're able to set from which host it connects from, maybe it's a problem with something like that.
    i might be talking out of my ass though, but maybe that could be something to look at
    hope it helps

  12. #12
    Join Date
    Feb 2005
    Posts
    2
    Have followed all the instructions, all applications work when tested on their own (webserver, php test page and can log into and create mysql databases etc) but when i try and get php and my sql to talk i end up with a blank webpage using the following code.

    DB_CONFIG

    <?php
    $db_host = "localhost";
    $db_user = "root";
    $db_password = "password i used whe installing and connecting to MYSQL in command prompt";
    $db_name = "panthro";
    ?>

    TEMP_CON.PHP

    <?php
    require($_SERVER["DOCUMENT_ROOT"]."/config/db_config.php");

    $connection = mysql_connect($db_name, $db_user, $db_password) or die("Error - Cannot connect to MYSQL Database");
    echo "Connected Successfully";
    ?>


    Any ideas??

  13. #13
    Join Date
    Feb 2005
    Posts
    2

    Smile

    Solved it! Turned out i'd missed a semi colon in the db_config.php file. As usual ansimple mistake causes excess grieve..

  14. #14
    Join Date
    Mar 2005
    Posts
    1
    I also just registered to say thanks.

  15. #15
    Join Date
    Nov 2005
    Posts
    1

    Php Mailer

    Can someone pls give me a free PHP mailer to download and how it works?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •