|
| Subject |
Author |
Status |
Date |
Re: The most trouble getting MySQL configured with PHP
|
Dorner Sodcup |
|
5/9/2008 2:46:18 AM |
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 dir ectory 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 Post Comments |
|
Re: I am using php5.0
|
Regwinder Singh |
|
5/9/2008 4:03:08 AM |
Hi, I am using php5.0 and mysql on winxp with IIS. I am getting a error stating PHP Warning: PHP Startup: Unable to load dynamic library '.\php_mssql.dll' - The specified module could not be found. in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '.\php_mysql.dll' - The specified procedure could not be found. in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '.\php_mysqli.dll' - The specified procedure could not be found. in Unknown on line 0. I have tried everything possible but cant seem to get this to work.
Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Dang Kettle |
|
5/9/2008 3:20:31 AM |
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??
Post Comments |
|
Re: Solved it!
|
Dang Kettle |
|
5/9/2008 3:22:31 AM |
Solved it! Turned out i'd missed a semi colon in the db_config.php file. As usual ansimple mistake causes excess grieve..
Post Comments |
|
Re: Thanks
|
Evzon Ologio |
|
5/9/2008 3:26:16 AM |
I also just registered to say thanks. Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Marienna Lopez |
|
5/9/2008 3:32:26 AM |
Can someone pls give me a free PHP mailer to download and how it w orks? Post Comments |
|
Re: Consider using php
|
Enrico Oreiton |
|
5/9/2008 3:35:11 AM |
You may want to consider using php_mysqli.dll instead. Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Malavika Anton |
|
5/9/2008 3:39:21 AM |
Greetings all. I am new to using PHP and have successfully installed php and apache, this means of course that the two work with simple things like phpinfo() and other short php scripts. My problem comes when, like most the others here, I try to set up mysql. I have copied .dll files to all sorts of folders, uncommented lines and it still isnt working. There are however two things that I have noticed. 1. the ext folder that everyone is referring to did not install with the php installer i used. I ended up just creating an empty file called ext which of course didnt work 2. in my phpinfo() script i find no occurance of MySql, not even in the path that is listed, but under set path on a command line i do see it there. Any help would be greatly appreciated. Post Comments |
|
Re: I just solved my problem with php configuratio n
|
Michael Calcupp |
|
5/9/2008 3:54:06 AM |
I just solved my problem with php configuration. I thought i had done everyting untill I found a swedish article on the subject.
There is four steps that needs to be done. One: edit the php.ini file uncoment extension=php_mysql.dll two: check the Directory in which the loadable extensions (modules) reside. for example extension_dir = "C:\php\ext" Three: check that the dll file exists in the obove location. Four: "important" copy the libmysql.dll file to the system directory C:\Windows\
This should work. PS dont forgett to reload the webserver Post Comments |
|
Re: No need to copy any files
|
Tangaama Coccikeiri |
|
5/9/2008 4:02:29 AM |
If you add the PHP installation folder to your Windows path (as the php.net installation instructions state) there is absolutely no need to copy any files around to get PHP or any extension to work. As always, the best and most current installation instructions are found in the PHP manual and in the installation.txt file that comes with PHP.
Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Saul Toropein |
|
5/9/2008 3:47:26 AM |
I am using Apache2.0.52, PHP5 and mysql4.0.21..when i run this program:
<?php // Connecting, selecting database $link = mysql_connect('localhost', '***', '***') or die('Could not connect: ' . mysql_error()); echo 'Connected successfully'; mysql_select_db('my_database') or die('Could not select database');
// Performing SQL query $query = 'SELECT * FROM my_table'; $result = mysql_query($query) or die('Query failed: ' . mysql_error());
// Printing results in HTML echo "<table>\n"; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "\t<tr>\n"; foreach ($line as $col_value) { echo "\t\t<td>$col_value</td>\n"; }
echo "\t</tr>\n"; }
echo "</table>\n";
// Free resultset mysql_free_result($result);
// Closing connection mysql_close($link); ?>
i get this error: Fatal error: Call to undefined function mysql_connect() in C:\Apache2\htdocs\connection.php on line 3
I have copied libmysql.dll and libmysqli.dll to system32 folder of my windows Xp..i have copied my php.ini to windows
dir and edited it..like i have uncomment this: extension=php_mysql.dll
I have added this to my path variable: ;C:\php5;c:\mysql\bin ...
i have done this too...extension_dir = "C:\php5\ext"
So why i m still getting this error...my phpinfo() is showing me the page powered by zend tech.. Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Kelpein Petcull |
|
5/9/2008 3:50:33 AM |
Somebody should please help me out, i have php 5.2, apache 2.2 and mysql 5.0.2 (Community server). i tried all my best to configure php and mysql, all to no avail. both of them are working indepently. i have tried all the steps above. and have used a lot tutorials PLEASE SOMEBODY HELP Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Tangaama Coccikeiri |
|
5/9/2008 3:52:32 AM |
Note to the last three members who posted in this sticky thread and who did not get a reply -
1) Sticky threads are for informational purposes, not for posting questions or problems. Create a new thread in the actual forum to post your question or your problem.
2) This sticky thread is right under the menu bar and the highlighting it gets when new posts are made to it is not easily noticed. If you want your post to get noticed, post it in the actual forum as a new thread.
3) Adding new occurrences of a same/similar problem onto the end of an existing thread is also a way to get your post ignored. Each person needs to start his own thread with an appropriate title. If you need to reference an existing thread, either include a link to it or include the pertinent portion of it as a quote in your new thread.
Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Tangaama Coccikeiri |
|
5/9/2008 3:52:35 AM |
Note to the last three members who posted in this sticky thread and who did not get a reply -
1) Sticky threads are for informational purposes, not for posting questions or problems. Create a new thread in the actual forum to post your question or your problem.
2) This sticky thread is right under the menu bar and the highlighting it gets when new posts are made to it is not easily noticed. If you want your post to get noticed, post it in the actual forum as a new thread.
3) Adding new occurrences of a same/similar problem onto the end of an existing thread is also a way to get your post ignored. Each person needs to start his own thread with an appropriate title. If you need to reference an existing thread, either include a link to it or include the pertinent portion of it as a quote in your new thread.
Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Wabou Lee |
|
5/9/2008 2:47:32 AM |
Hey Velmeidi, That's a good information you have provided. In PHP5 mysql support you have to manualy configure. This would be helpfull for newbies.
Regards Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Jerinna Flangan |
|
5/9/2008 2:49:22 AM |
This is now a sticky...
Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Bucefal Derby |
|
5/9/2008 2:50:05 AM |
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 y our firewall (which would otherwise block Apache and MySQL of course), remembering that MySQL uses an unusual port number (3306). Post Comments |
|
Re: Thank you
|
Dominigo Paitiam |
|
5/9/2008 3:38:36 AM |
Thank you, thank you, thank you, thank you, thank you, thank you, thank you!!!
I've been looking for this for ages. You've really really helped me. Thanks again.
Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Tapan Gallagher |
|
5/9/2008 3:00:31 AM |
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. Post Comments |
|
Re: check the setup process
|
Dorner Sodcup |
|
5/9/2008 3:02:37 AM |
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();
?>
Post Comments |
|
Re: Thanks
|
Carla Chileira |
|
5/9/2008 3:05:42 AM |
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
Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Parten Onslow |
|
5/9/2008 3:05:10 AM |
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, Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Thomas Billings |
|
5/9/2008 3:12:40 AM |
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 Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Rebbecca Stein |
|
5/9/2008 3:15:23 AM |
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??
Post Comments |
|
Re: The most trouble getting MySQL configured with PHP
|
Thomas Billings |
|
5/9/2008 3:17:34 AM |
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 Post Comments |
|