|
Posted by Bruce A. Julseth on 06/17/05 04:33
"Bruce A. Julseth" <bruceajNoSpam@attglobal.net> wrote in message
news:42b225dc_4@news1.prserv.net...
>
> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
> news:e-adnew4de1JUizfRVn-gA@comcast.com...
>> Bruce A. Julseth wrote:
>>> I have:
>>>
>>> MySQL 4.1
>>> PHP 5.0.4 (I think. The News.txt says 31 Mar 2005, PHP 5.0.4)
>>> Apache 2.0.50
>>>
>>> When I try to connect to MySQL, via PHP, with
>>>
>>> $db = mysql_pconnect('localhost', 'user', 'pw');
>>>
>>> I get
>>>
>>> Fatal error: Call to undefined function mysql_pconnect() in
>>> C:\Inetpub\wwwroot\MySqlTest\Default.php on line 4
>>>
>>> What is my problem?
>>>
>>> Thanks..
>>>
>>> Bruce
>>
>> Bruce,
>>
>> You probably don't have the mysql extensions enabled in php. Look in
>> your php.ini file for the line
>>
>> ;extension=php_mysql.dll
>>
>> Remove the ";" from the first line to load the extension. Also, ensure
>> the extension_dir is set, i.e.
>>
>> extension_dir = "c:/php/ext/"
>>
>> (or wherever you placed php).
>>
>> Also, with MySQL 4.1, you'll probably want to use the "new and improved"
>> mysql interface, mysqli_xxx. To use these, add the following line:
>>
>> extension=php_mysqli.dll
>>
>> You'll also need to ensure libmysql.dll is accessible; the best way to
>> ensure this is to set your PATH statement to point to the directory
>> containing it.
>>
>> One other thing - is your host also running PHP 5.0.4 and MySQL 4.1? I've
>> found it easier to test if I'm running the same version as my host.
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstucklex@attglobal.net
>> ==================
>
> Thanks for the response. I'll check on what you have suggested. One thing.
> PHP files are being handled. I can code:
>
> <?
> $mess = "My Message";
> ?>
>
> Then in my html I can have
>
> <?
> echo $mess;
>
> ?>
>
> and $mess is displayed..
>
> As such, I think the php extension is enabled. But, as I said, I will
> check out what you have said.
>
> Thanks....
>
Jerry:
Changing the PHP.ini seems to have worked. At least the error message is
gone. I need to add some more code to make sure, but it looks good.
As for the host, good point. I'm using "GoDaddy" for my host. I'll check
with them to see the level they're using. Thanks for the suggestion.
Bruce
Navigation:
[Reply to this message]
|