Newbie Question

This is a discussion on Newbie Question within the PHP Language forums, part of the PHP Programming Forums category; I have: MySQL 4.1 PHP 5.0.4 (I think. The News.txt says 31 Mar 2005, PHP 5....


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-16-2005
Bruce A. Julseth
 
Posts: n/a
Default Newbie Question

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


Reply With Quote
  #2 (permalink)  
Old 06-16-2005
Jerry Stuckle
 
Posts: n/a
Default Re: Newbie Question

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
==================
Reply With Quote
  #3 (permalink)  
Old 06-17-2005
Bruce A. Julseth
 
Posts: n/a
Default Re: Newbie Question


"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....


Reply With Quote
  #4 (permalink)  
Old 06-17-2005
Bruce A. Julseth
 
Posts: n/a
Default Re: Newbie Question


"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


Reply With Quote
  #5 (permalink)  
Old 06-17-2005
Jerry Stuckle
 
Posts: n/a
Default Re: Newbie Question

Bruce A. Julseth wrote:
> "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....
>
>


Bruce,

All that shows is that PHP is working. As you found, you still need to
load the appropriate PHP extensions (in this case the MySQL extension to
PHP).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 11:56 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0