473,378 Members | 1,410 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Fatal error: Call to undefined function

gc
I'm a PHP and MySQL newbie. I have a feeling a lot of you may have seen this
before. I'm teaching myself PHP/MySQL and trying to setup a guestbook. I'm
running latest versions of Apache, PHP and MySql on WIN 2000. PHP is
installed from the zip file. When serving php docs (code snippets below) I
get the messages:

"Fatal error: Call to undefined function mysql_connect() "

"Fatal error: Call to undefined function mysql_pconnect() "

I've been reading and searching and trying all sorts of things to fix this
and can't find the solution. I've removed the comment from the line
"extension=php_mysql.dll" in php.ini. (Below is the MySQL section of
php.ini. It's pretty standard, I'm using defaults.) I edited my Apache
config file with the needed lines:

### Section 4: PHP 5 Module
#
LoadModule php5_module "C:/Program Files/Apache
Group/Apache2/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir "C:/Program Files/Apache Group/Apache2/PHP"

When I run phpinfo, MySQL is not listed. Do I need to enable it in the
configure command? How do I edit the configure command. Per phpinfo, It now
reads:

Configure Command cscript /nologo configure.js "--with-gd=shared"
"--enable-snapshot-build"

I read these comments online:

Ok, your php.ini file is set to 'on' for mysql.allow_persistent, but is
mysql really enabled? Does your configure command look something like this?

'./configure'
'--with-mysql=/usr/local/mysql'............................................

If you don't have --with-mysql it means that you cannot use mysql
functions, so compile PHP again with this option.

How do I edit that pesky configure command. I searched, but couldn't find an
answer. So, where am I going wrong? Thanks for reading and big thanks for
any help.

gene

su******@verizon.net

php.ini snippet (comments removed for easier reading:

[MySQL]
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
guest.php code snippet:

//connect
// change localhost to your db host name
mysql_pconnect( "http://aulon.dyndns.org/", "$username", "$password")
or die( "Unable to connect to SQL server");
mysql_select_db( "$db_name") or die( "Unable to select database");
guestbook.php code snippet:
// Connect to DB
$li = mysql_connect($dbHost, $dbUser, $dbPass) or die("Could not connect");
mysql_select_db($dbDatabase, $li) or die ("could not select DB");
Jul 17 '05 #1
4 15316
gc wrote:
I've been reading and searching and trying all sorts of things to fix this
and can't find the solution. I've removed the comment from the line
"extension=php_mysql.dll" in php.ini. (Below is the MySQL section of
php.ini. It's pretty standard, I'm using defaults.) I edited my Apache
config file with the needed lines:
So you've uncommented the extension line in php.ini - have you copied
libMySQL.dll from the PHP directory (or one of the directories under it
- I forget what the dir is called now) into your \windows\system32 or
equivilant directory? PHP needs this MySQL client library for the
extension to work.
How do I edit that pesky configure command. I searched, but couldn't find an
answer. So, where am I going wrong? Thanks for reading and big thanks for
any help.


You can't edit the configure command with a Windows binary distribution
- the configure command is passed at build-time but you aren't building
from source.

--
Jasper Bryant-Greene
Cabbage Promotions
Jul 17 '05 #2
gc wrote:
I'm a PHP and MySQL newbie. I have a feeling a lot of you may have
seen this before. I'm teaching myself PHP/MySQL and trying to setup a
guestbook. I'm running latest versions of Apache, PHP and MySql on
WIN 2000. PHP is installed from the zip file. When serving php docs
(code snippets below) I get the messages:

"Fatal error: Call to undefined function mysql_connect() "

"Fatal error: Call to undefined function mysql_pconnect() "

I've been reading and searching and trying all sorts of things to fix
this and can't find the solution. I've removed the comment from the
line "extension=php_mysql.dll" in php.ini. (Below is the MySQL
section of php.ini. It's pretty standard, I'm using defaults.) I
edited my Apache config file with the needed lines:

### Section 4: PHP 5 Module
#
LoadModule php5_module "C:/Program Files/Apache
Group/Apache2/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir "C:/Program Files/Apache Group/Apache2/PHP"

Latest MySQL and PHP5 don't mix by default on Windows. You need another
Mysqllib. There are some functions that no longer exist in PHP I believe. I
found it a nightmare to get it to work, but others can probably point out
how exactly to do this. I gave up after hours of toying, went back to PHP
4.3.8 so I can't exactly tell you how to go about it.

Good luck
Pjotr
Jul 17 '05 #3
gc
Thanks, Pjotr! I went to v4.3.8 and it works with no problems! What a
headache that was trying to get v5 to work, and me being a newbie, it was
really not fun at all.

Thanks also, to everyone that replied.
gene

"Pjotr Wedersteers" <x3****@westerterp.com> wrote in message
news:41***********************@news.xs4all.nl...
gc wrote:
I'm a PHP and MySQL newbie. I have a feeling a lot of you may have
seen this before. I'm teaching myself PHP/MySQL and trying to setup a
guestbook. I'm running latest versions of Apache, PHP and MySql on
WIN 2000. PHP is installed from the zip file. When serving php docs
(code snippets below) I get the messages:

"Fatal error: Call to undefined function mysql_connect() "

"Fatal error: Call to undefined function mysql_pconnect() "

I've been reading and searching and trying all sorts of things to fix
this and can't find the solution. I've removed the comment from the
line "extension=php_mysql.dll" in php.ini. (Below is the MySQL
section of php.ini. It's pretty standard, I'm using defaults.) I
edited my Apache config file with the needed lines:

### Section 4: PHP 5 Module
#
LoadModule php5_module "C:/Program Files/Apache
Group/Apache2/PHP/php5apache2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir "C:/Program Files/Apache Group/Apache2/PHP"
Latest MySQL and PHP5 don't mix by default on Windows. You need another
Mysqllib. There are some functions that no longer exist in PHP I believe.

I found it a nightmare to get it to work, but others can probably point out
how exactly to do this. I gave up after hours of toying, went back to PHP
4.3.8 so I can't exactly tell you how to go about it.

Good luck
Pjotr

Jul 17 '05 #4
gc wrote:
Thanks, Pjotr! I went to v4.3.8 and it works with no problems! What a
headache that was trying to get v5 to work, and me being a newbie, it was
really not fun at all.
Next time just put your libmysql.dll in your PATH environment.

AND hell STOP multiposting!!
You said newbie?
Thanks also, to everyone that replied.
gene


Sebastian
--
The most likely way for the world to be destroyed,
most experts agree, is by accident.
That's where we come in; we're computer professionals.
We cause accidents.
--Nathaniel Borenstein
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Daniel Hansen | last post by:
I am getting a "Fatal error: Call to undefined function: imagecreatefromjpeg() in..." error in one of my scripts, and after doing a bit of searching on the 'net I found various messages relating to...
5
by: Randell D. | last post by:
Folks, I feel like pulling my hair out - I tried unsuccessfully over the past few days to install ImagMagick but because of version conflicts and missing libraries I had to give up. I originally...
8
by: Tim Tyler | last post by:
I'm getting fatal errors when executing code - and my error handler is failing to trap them - so I get no stack backtrace :-( The error I am getting is: "Fatal error: Call to a member function...
1
by: drewmania001 | last post by:
i've read various info on the web including the following http://php.mirrors.ilisys.com.au/manual/en/ref.mysqli.php mySQL Version 4.1.16 PHP Version 5.1.2 with Zend Engine v2.1.0 OS Windows...
2
by: salvadorvp | last post by:
Hi, I have the following code that gives me this odd error message at a line of code inside the PEAR libraries: "Fatal error: Call to undefined function: MDB2_Driver_mssql::getMessage(). in...
9
by: java | last post by:
Hey there, I just removed an elderly PHP4-Installation from my Windows-Box and installed PHP 5.2.1. I used the PHP4-Module as local batchfile- interpreter by E:\ersDHCP>php ./extractLog.php ...
3
by: Ming | last post by:
I am new to php5 programming :) I redirect users to another server to login. After they login successfully, they will be redirected to test.php. The server provides xml_rpc interface so I can...
4
by: nickyspace | last post by:
HI all I have a little issue with this php code. Below is the code CODE: PHP 1.<?
1
by: inetquestion | last post by:
I am getting this error: "Fatal error: Call to undefined function socket()" even after reinstalling php4 and php5 with the following configuration: ./configure --with-gd=/usr/local --with-mysql...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.