Re: PHP5 and MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I don't use MySQL however, on my XP machine...

The php.ini file is in the Windows directory. Open that file scroll down to a list of Windows extensions, you should find something as follows:

;extension=php_msql.dll
;extension=php_mysql.dll
;extension=php_oci8.dll

Remove the semi-colon before the line that includes mysql, as follows:

;extension=php_msql.dll
extension=php_mysql.dll
;extension=php_oci8.dll

Save the file. Now go to the PHP folder and look inside the ext folder, in there you should find the php_mysql.dll file. This means that your path should be C:/PHP/ext (assuming that PHP is in the default location viz C:/). Now look for the switch in the PHP.ini file called extension_dir, change this to match the path just found, so I currently have:

extension_dir = "C:\PHP\ext"

Now restart Apache. This will reload your php.ini file and ... low and behold you will get an error... Can't find the dll libmysql.dll. This is in the PHP folder, take a copy and place it in the C:/Windows/system32 folder and restart Apache. This time everything should run smothly check by loading a page with phpinfo().

I followed these steps on my machine and I now have phpinfo() displayed.

hope this helps.

graeme.


JC Botha wrote:

Ok, I did the phpinfo() and only the SQLlite is listed there, no MySQL
is listed. I did enable the php_mysql.dll and set the windows path to
c:\php. What else it there that I can look at. Thanks for all the
links sent to me, I read them all and try to follow the instructions
but some how I dont do someting tight on my XP computer.

If somebody is willing to review my php.ini file let me know and I
will email it to you.

Thanks

On 4/15/05, Janet Valade <jvalade@xxxxxxxx> wrote:


JC Botha wrote:



This is the Browser error:
Fatal error: Call to undefined function mysql_connect() in
C:\apache\htdocs\cedarintranet\index.php on line 3


This error means that MySQL support is not enabled in your PHP.  In PHP
4, this was done automatically. Now you need to enable it yourself when
you install. You can tell whether it's enabled by running a phpinfo()
statement in your PHP script. This statement outputs a long list of PHP
settings. Somewhere in that list, it provides a block of MySQL settings
for installations that have MySQL support enabled. If your output
doesn't show the MySQL settings, then MySQL support is not enabled.

To enable it on a Windows machine, in your php.ini file, uncomment the
"extension" line for mysql. You may need to restart Apache after you
edit the php.ini file. Be sure you are making changes in the php.ini
file that PHP is using. The output, mentioned above, from phpinfo()
shows the path to the php.ini file that PHP is using.

Janet



This is my php code:
// Connect to the database server
     $dbcnx = mysql_connect("localhost", "intranet", "1234");
     if (!$dbcnx) {
             echo( "<P>Unable to connect to the " .
                "database server at this time. Please make use of the contact page.</P>" );
             exit();
     }

     // Select the database
     if (!@mysql_select_db("cedarintranet") ) {
             echo( "<P>Unable to connect to the " .
                     "database server at this time. Please contact webmaster at
jcbotha@xxxxxxxxxxxx</P>" );
             exit();
     }


On 4/15/05, Kevin Smith <kevin@xxxxxxxxxxxxxxx> wrote:



Perhaps posting you code will help us resolve your problem.

JC Botha wrote:




Dear Users

I'm havin a problem to connect to MySQL through the use of PHP5. I
followed all documentation and none seem to resolve the problem. I'm
running WinXP on the computer that I use to develop the apps. Any
advice out there that could be of help.

Thanks





--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






--
Janet Valade -- janet.valade.com








-- Experience is a good teacher, but she sends in terrific bills.

Minna Antrim


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux