NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
MySQLi


Joined: 13 Aug 2009
Posts: 4
Reply with quote
Does the current version of phpED -5.8- support mysqli?
I am stuck with the following error when running in the IDE:
Fatal error: Class 'mysqli' not found in <filename> on line 3:
Code:

1  <?php
2      print phpinfo(INFO_MODULES);
3      $mysqli = new mysqli($host, $user, $pass, $db);
4      $mysqli->close(); 
5  ?>

I have checked that the extensions are activated in php.ini (php_mysql.dll and php_mysqli.dll), that the php.ini file referenced when doing a phpinfo is the same. I have check also that the extensions path in php.ini is correct.

phpinfo(INFO_MODULES) give the following information for mysql: client API version 5.0.51a

Am I missing anything?
View user's profileFind all posts by jpiSend private message
Veteran

Joined: 22 May 2008
Posts: 141
Reply with quote
Are you absolutely sure mysqli is enabled?

Running a base install of PHPEd 5.8, its not enabled for me when I do a Ctrl + F9 with phpinfo().
Also, just to make sure you know, mysql and mysqli are 2 different things.
View user's profileFind all posts by simshaunSend private message
mySQLi


Joined: 13 Aug 2009
Posts: 4
Reply with quote
As far as I can check it seems to be enabled, unless there is some other hidden settings that I am not aware of, enabling the extension should have been the only thing I needed to do. Also, I could have swear that the first test I made was working (I wrote a function using mySQLi, consuming some data from the DB), and it was working. Then I started working on another function, that did not work. From that point on I started to track back, up to the code sample I gave earlier, and I keep having the same message now. Because I needed to move on, I used mySQL functions instead, but I am very curious to try to understand why it is not working now, and how to fix it.

Do you have any suggestions to help me checking if indeed it is properly installed?

Thanks
View user's profileFind all posts by jpiSend private message
Re: MySQLi
Veteran

Joined: 06 Jun 2007
Posts: 289
Location: Vancouver, Canada
Reply with quote
jpi wrote:
I have checked that the extensions are activated in php.ini (php_mysql.dll and php_mysqli.dll), that the php.ini file referenced when doing a phpinfo is the same. I have check also that the extensions path in php.ini is correct.

Your phpinfo() output will tell you without any doubt whether mysqli is indeed enabled. You should see a mysqli heading together with all the mysqli directives.

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


Joined: 13 Aug 2009
Posts: 4
Reply with quote
I found it out at the end of the day. I was testing this behavior on two different machines one Vista Ultimate 64, and one Windows 7 Ultimate 64. I have noticed that if I am running as an Administrator, it does indeed work as intended, and phpinfo ends up displaying the informations for the mySQLi extension. However when running with a restricted account, none of the changes made in php.ini file seems to be taken in consideration [maybe only after a reboot, but I am not sure yet.

I will continue to investigate and post later on if I find a way to work with a restricted account without ill side effect. Right now however a workaround exists under Vista and/or 7, work with and administrative account.
View user's profileFind all posts by jpiSend private message
Veteran

Joined: 22 May 2008
Posts: 141
Reply with quote
Hmm, are you restarting PHPEd's server after you change the php.ini file?
After opening a preview window for a PHP file, you should see a globe icon in your taskbar.
Right click it and click "Stop server". Make your php.ini changes, then Start server.
View user's profileFind all posts by simshaunSend private message


Joined: 13 Aug 2009
Posts: 4
Reply with quote
Yes I was generally stoping and restarting the processes including debugger and listener after any changes. Because the php file is installed under C:\Program Files, any modification (notably activating extension) could be done only with an administrative account. However when running as a non administrative account, the modifications were not taken in consideration thus I was still using the default configuration for which the extension is not activated.

However I must admit that the behavior is inconsistent somehow and confusing. Now however I can enable/disable the extension at will on the vista box, I will check later if it is possible to do the same with the windows 7 box later.
View user's profileFind all posts by jpiSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
when running with a restricted account, none of the changes made in php.ini file seems to be taken in consideration


That's correct and an expected behaviour. You can not change php.ini under restricted account. You can not change ANY files in %PROGRAMFILES% directory being logged under restricted account. Other sensitive directories are protected too. That's the restriction in MS terms. Please read your OS manuals for further details.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
MySQLi
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