Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2007
    Posts
    3

    Unanswered: Running MySQL with localhost:8080?

    Hey I am a PHP user new to MySQL and I've been trying to install it per this online tutorial http://www.expertsrt.com/tutorials/M...ll-apache.html.

    Everything's working, my php is on, my mysql works in command prompt, but I can't get PHP5 to recognize MySQL. I've done all the following

    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



    1. Placed php.ini in the windows directory.
    2. copied libmysql.dll to the system32 directory
    3. set the extension_dir in php.ini to the ext directory of the PHP installation directory (in my case extension_dir=C:\web\webserver\php\ext)
    4. enable the MySQL extension in php.ini by uncommenting the line extension=php_mysql.dll

    According to everything I've found, this should do the trick. However, although they run fine separately, they won't go together.

    My question is, if I'm not running on localhost, but localhost:8080, are there different things I have to do? And what else could be the problem?

    As a side note... why won't phpinfo.php run in Firefox? I only get a bunch of ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????/

    Thanks

  2. #2
    Join Date
    Apr 2006
    Location
    Denver, Co. USA
    Posts
    242
    Firstly, that web page is out of date and contains a mis-match of instructions for old and new versions. The best place to obtain current information are directly from the apache, php, and mysql web sites and the documentation they publish. PHP works fine with Apache2.2 and you should probably be using the latest versions of all three pieces of software.

    Is it just a phpinfo.php (i assume this has a phpinfo() statement in it) script that does not work or do all .php scripts not work and is this just with Firefox or does it actually work for a different browser? What does the "view source" of the page in the browser look like?

    I can't get PHP5 to recognize MySQL
    What symptoms or errors do you have? Show the php script you are using.

    Here is rundown of what I see based on the info you posted -

    LoadModule php5_module php5apache2.dll - you need to specify the full file system path to where the .dll is located. Something like - LoadModule php5_module "C:\web\webserver\php\php5apache2_2.dll" (this it what it would be for Apache2.2)

    Place a PHPIniDir statement in the httpd.conf to indicate where the php.ini file is located. Something like - PHPIniDir "C:\web\webserver\php"

    There is no guarantee that php is finding the php.ini you put in the windows folder and it is probably using defaults and any changes you have made to it are not being used.

    For your numbered items -

    1. If you do the above PHPIniDir item, there is no need to put anything in the windows folder.
    2. Add the path to the php folder to your windows path statement and there is no need to copy any extension files around to get any extension to work. (you must either reboot or log off/log on for the actual path statement to be updated.)
    3. What you have should work. Are the extension .dll files actually present in that folder?
    4. Any changes to php.ini (assuming that php is using the one you are making changes to) or httpd.conf only take effect when the web server is stopped and started.

    Unless you want to always enter the :8080 every time you type a url, I recommend using the default port 80. There are few poorly written anti-virus utilities that listen on port 80 and don't properly forward requests made to that port that would interfere with a web server using that port, but I have not seen many posts about this problem lately, so perhaps the current version of software causing this have been fixed.
    Last edited by dbmab; 08-04-07 at 14:40.

  3. #3
    Join Date
    Aug 2007
    Posts
    3
    Alright, I downloaded Apache 2.2 and then chose Port 80, made all the necessary changes, and not only does phpinfo() actually show up in Firefox, there's a nice little mysql section! thanks for the help, i appreciate it

Posting Permissions

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