PHP & mySQL
Blake Skinner
yellowdog-general@lists.terrasoftsolutions.com
Sat Jun 22 19:52:01 2002
--Apple-Mail-1--754665083
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
The default install of PHP included with YDL does not function properly
when MySQL or Postgresql calls are made to it. All the problems lie in
the php.ini file so open this file in your favorite editor and search
for "extension_dir".
Change the line to:
extension_dir = /usr/lib/php4
Next, search for extension until you come to the following section:
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
insert the following:
; Unix Extensions
extension=imap.so
extension=ldap.so
extension=odbc.so
extension=pgsql.so
extension=mysql.so
Finally, restart httpd (service httpd restart)
On Saturday, June 22, 2002, at 06:34 PM, Zack wrote:
> I get an odd error message in when I attempt to use mysql_connect in a
> php script:
>
> Fatal error: Call to undefined function: mysql_connect() in
> /home/sherlock/public_html/newsite/blah2.php on line 16
>
> Here is my php code, which has worked on other servers before:
>
> <?php
> // Set the variables for the database access:
> $Host = "localhost";
> $User = "root";
> $Password = "<not displayed";
> $DBName = "sherlock";
> $TableName = "property";
>
> $Link = mysql_connect ($Host, $User, $Password) or die( mysql_error() );
> $Query = "SELECT * from $TableName";
> $Result = mysql_db_query ($DBName, $Query, $Link) or die
> ( mysql_error() );
> ?>
>
>
> To install Apache, mySQL, & PHP, I used "apt-get install apache mysql
> php" which downloaded and installed the appropriate packages.
>
> I have enabled mysql support in both php.ini and httpd.conf.
>
> All other PHP functions, including writing to a text file, seem to
> function just fine.
>
> I have even reinstalled Apache, mySQL & PHP.
>
> Anyone have any idea why mysql_connect AND mysql_pconnect would return
> as an undefined function? Its as if PHP has no idea what a mysql
> database is, even though it has built in support for it.
>
> Any help is greatly appreciated, and I thank you in advance.
>
> And yes, this is running on Yellow Dog Linux 2.2
>
> Thanks,
>
> -Z
>
>
> --
> _____________________
> I feel more like I do right now than I did a while ago.
>
>
>
> __________________________________________________________________
> Your favorite stores, helpful shopping tools and great gift ideas.
> Experience the convenience of buying online with Shop@Netscape!
> http://shopnow.netscape.com/
>
> Get your own FREE, personal Netscape Mail account today at
> http://webmail.netscape.com/
>
> _______________________________________________
> yellowdog-general mailing list
> yellowdog-general@lists.terrasoftsolutions.com
> http://lists.terrasoftsolutions.com/mailman/listinfo/yellowdog-general
--Apple-Mail-1--754665083
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
charset=US-ASCII
<fontfamily><param>Lucida Grande</param>The default install of PHP
included with YDL does not function properly when MySQL or Postgresql
calls are made to it. All the problems lie in the php.ini file so open
this file in your favorite editor and search for "extension_dir".
Change the line to:
extension_dir = /usr/lib/php4
Next, search for extension until you come to the following section:
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
insert the following:
; Unix Extensions
extension=imap.so
extension=ldap.so
extension=odbc.so
extension=pgsql.so
extension=mysql.so
Finally, restart httpd (service httpd restart)<bigger>
</bigger></fontfamily>
On Saturday, June 22, 2002, at 06:34 PM, Zack wrote:
<excerpt>I get an odd error message in when I attempt to use
mysql_connect in a php script:
Fatal error: Call to undefined function: mysql_connect() in
/home/sherlock/public_html/newsite/blah2.php on line 16
Here is my php code, which has worked on other servers before:
<<?php
// Set the variables for the database access:
$Host = "localhost";
$User = "root";
$Password = "<<not displayed";
$DBName = "sherlock";
$TableName = "property";
$Link = mysql_connect ($Host, $User, $Password) or die( mysql_error()
);
$Query = "SELECT * from $TableName";
$Result = mysql_db_query ($DBName, $Query, $Link) or die(
mysql_error() );
?>
To install Apache, mySQL, & PHP, I used "apt-get install apache mysql
php" which downloaded and installed the appropriate packages.
I have enabled mysql support in both php.ini and httpd.conf.
All other PHP functions, including writing to a text file, seem to
function just fine.
I have even reinstalled Apache, mySQL & PHP.
Anyone have any idea why mysql_connect AND mysql_pconnect would return
as an undefined function? Its as if PHP has no idea what a mysql
database is, even though it has built in support for it.
Any help is greatly appreciated, and I thank you in advance.
And yes, this is running on Yellow Dog Linux 2.2
Thanks,
-Z
--
_____________________
I feel more like I do right now than I did a while ago.
__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas.
Experience the convenience of buying online with Shop@Netscape!
http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at
http://webmail.netscape.com/
_______________________________________________
yellowdog-general mailing list
yellowdog-general@lists.terrasoftsolutions.com
http://lists.terrasoftsolutions.com/mailman/listinfo/yellowdog-general
</excerpt>
--Apple-Mail-1--754665083--