NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
[resolved] Call to undefined function mysql_pconnect() ..


Joined: 29 Dec 2007
Posts: 4
Reply with quote
I installed the trial version of PhpEd 5.2, but when I want to debug, I get the following message:

Error: E_ERROR
Call to undefined function mysql_pconnect()
at wHeadFrame.php line 21


Ok, I know that I am not the first one who asks that question, but the previous answers did not solve my problem.
Does anybody know what is wrong? I spent much time but couldn't find a solution.

My installation:
Windows XP
Nusphere package: NuSphere-phped-5.2evl-Win32.exe
(only PHP5 selected for installation, not PHP4)
MySql: mysql-5.0.41-win32.zip


Settings
Php.ini
There is only 1 file named php.ini. I moved it to c:\windows.

extension_dir = "C:\Pr\nusphere\phped\php5\extensions"
...
;extension=php_mysql.dll
extension=php_mysqli.dll



Environment variable
PHPRC C:\Windows
(Having invoked PhpEd, the name of this variable is automatically renamed to PHPRC~. I had clicked the button ‘Solve this problem’ when I got a warning before. Now I do not get a warning any longer.)

libmysql.dll
I copied the file from C:\Pr\MySQL\MySQL Server 5.0\bin
to C:\Pr\nusphere\phped
and C:\Pr\nusphere\phped\php5



Phpinfo.php
Configuration File (php.ini) Path: C:\WINDOWS
Loaded Configuration File: C:\WINDOWS\php.ini
PHP Extension: 20060613



At the beginning (when I invoked PhpEd for the 1st time) this additional error has been displayed, but now it does not appear any longer:

‘Failed to run SRV web server.
Check if TCP/8080 port is in use by another application.
See: Tools->Settings->SRV web server, Server Port’

But there is only one application listed that uses port 8080:
c:\Pr\nusphere\phped\php5\php-cgi.exe
What is the reason for this warning?
View user's profileFind all posts by HenrySend private message
Veteran

Joined: 06 Jun 2007
Posts: 289
Location: Vancouver, Canada
Reply with quote
I think you do not have the correct MySQL extension active. The mysql_pconnect() function belongs to the mysql extension, not mysqli. You should uncomment the line
Code:
extension=php_mysql.dll

_________________
Smile
View user's profileFind all posts by annoSend private messageVisit poster's website


Joined: 29 Dec 2007
Posts: 4
Reply with quote
anno wrote:
I think you do not have the correct MySQL extension active. The mysql_pconnect() function belongs to the mysql extension, not mysqli. You should uncomment the line
Code:
extension=php_mysql.dll


Thank you, anno.
No, that did not solve the problem. The same error message still appears.

I had chosen mysqli because I read somewhere that it is required if you want to have the full functionality of MySql 4.1 and higher.
Besides that I think Dimitry suggested in a similar case to uncomment this extension.
View user's profileFind all posts by HenrySend private message


Joined: 29 Dec 2007
Posts: 4
Reply with quote
I forgot to mention that phpinfo() does not show up with a MySql section.
Can anybody tell me what might have gone wrong?

In the MySQL 5.0 Reference Manual I found the following note:
Quote:
Fatal error: Call to unsupported or undefined function mysql_connect() in ...: This means that your PHP version isn't compiled with MySQL support. You can either compile a dynamic MySQL module and load it into PHP or recompile PHP with built-in MySQL support. This process is described in detail in the PHP manual.


Is there a chance that Nusphere's package NuSphere-phped-5.2evl-Win32.exe has been compiled without support for MySQL?
View user's profileFind all posts by HenrySend private message
Veteran

Joined: 06 Jun 2007
Posts: 289
Location: Vancouver, Canada
Reply with quote
Quote:
I forgot to mention that phpinfo() does not show up with a MySql section.
Can anybody tell me what might have gone wrong?

No MySQL section in the phpinfo() suggests that the MySQL extension is not loading. That explains why mysql_pconnect() does not work.

Quote:
Is there a chance that Nusphere's package NuSphere-phped-5.2evl-Win32.exe has been compiled without support for MySQL?
On Linux, one has go compile modules into PHP. On Windows, however, modules are simply enabled in php.ini.

Things that I would check/try:
* Perhaps you are editing the wrong php.ini? In you phpinfo() output, check the location of php.ini (it is displayed near the top of the output). Your previous post suggests it is C:\WINDOWS\php.ini.
* Check that php_mysql.dll is present in your extensions folder.
* Set "display_startup_errors = On" in your php.ini to see any possible errors with loading of extensions.

_________________
Smile
View user's profileFind all posts by annoSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Stephen (anno) is correct. Please follow his suggestions.
Quote:
Fatal error: Call to unsupported or undefined function mysql_connect() in ...: This means that your PHP version isn't compiled with MySQL support.

This is a misleading comment for Win32 system where mysql extension is not compiled in, but provided as a separated module. You have to add extension=php_mysql.dll into your php.ini.


Quote:
Is there a chance that Nusphere's package NuSphere-phped-5.2evl-Win32.exe has been compiled without support for MySQL?

no, there is no chance like this.


Last edited by dmitri on Sun Dec 30, 2007 3:51 pm; edited 1 time in total

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Dec 2007
Posts: 4
Reply with quote
Thank you Annon, thank you Dmitri

I followed your suggestions:
- php.ini is in c:\windows and I only have one file php.ini.
(I checked that with SEARCH.)
- The output of phpinfo still shows up with the same data:
Configuration File (php.ini) Path: C:\WINDOWS
Loaded Configuration File: C:\WINDOWS\php.ini
- php_mysqli.dll and php_mysql.dll are in c:\Pr\nusphere\phped\php5\extensions


With "display_startup_errors = On"
I got the following warning:

"PHP Startup: Unable to load dynamic library 'c:\Pr\nusphere\phped\php5\extensions\php_mysqli.dll - Unzulässiger Zugriff auf einen

Speicherbereich."


The last sentence means "Unallowed access to storage."
I unchecked Write Protection for folder c:\Pr\nusphere\phped\php5\extensions and clicked the OK button.
Having selected properties of that folder again, I learned that Write Protection had not been removed.
So the warning still appears.

You suggested to use php_mysql.dll instead of php_mysqli. But the result is the same, i.e. the same warning.
Having invoked phpinfo.php5 an additional warning for php_pdo_mysql.dll showed up.
The files php_mysqli.dll and php_mysql.dll are not write protected nor do they have the hidden or archive attribute set.

I activated "Make this folder available in the network"
and "Network users are allowed to modify files". But that made no difference.

Is it necessary to remove Write Protection for that folder?
It should be possible to use attrib to modify attributes of a folder. But are there any other consequences?
View user's profileFind all posts by HenrySend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
First of all, remove php.ini from Windows folder and do not put it there.
Then, make sure that you run php from nusphere\php or nusphere\php5 folders if you need php v4 or v5 respectively.
Each php should be equipped with its own php.ini and they must be in nusphere\php and nusphere\php5 directories.

If you run 3rd party web server such as IIS or Apache, make sure that their copy of php.ini is in their folders. For example if you have Apache 2.2 (httpd.exe) in c:\program files\apache group\apache\bin\httpd.exe, its php.ini should be in c:\program files\apache group\apache\bin
This way you'll avoid conflicts between different php versions installed on your system.

Regarding file permissions, it's also a misleading error message. It's sufficient to have Read & Execute permissions.
On the other hand, php_mysql.dll depends on libmysql.dll and if latter is not found, php will fail to load php_mysql.dll too. So, make sure that libmysql.dll is either available in one of the directories listed in PATH environment variable or is in the php directories (one copy for each)

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
[resolved] Call to undefined function mysql_pconnect() ..
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic