Connecting Tech Pros Worldwide Help | Site Map

PHP5 and MySQLi connection problem

Tim
Guest
 
Posts: n/a
#1: Jul 17 '05
I have trouble with MySQL 5 and PHP 5.0.2, using XP SP1 with IIS.

I can get PHP to access MySQL using CGI and the (older) MySQL
functions, but when I try and use ISAPI and MySQLi functions I have a
problem ....

Fatal error: Call to undefined function mysqli_connect() in (php
file name)

(this message is from just trying to do a connect).

I have checked all permissions, set-up PHP and MySQL according to the
instructions and have enabled mySQLi in the php.ini file, re-booted
but still no luck.

With it setup for CGI, the MySQL details appeared with phpinfo, but
with ISAPI no details appear with phpinfo.

Any help or ideas would be greatly appreciated.
Polaris
Guest
 
Posts: n/a
#2: Jul 17 '05

re: PHP5 and MySQLi connection problem


And did you copy all .dll's to windows\system32 ?


"Tim" <tim.bullock@mail.com> schreef in bericht
news:ea684cfc.0410090339.3a634afa@posting.google.c om...[color=blue]
>I have trouble with MySQL 5 and PHP 5.0.2, using XP SP1 with IIS.
>
> I can get PHP to access MySQL using CGI and the (older) MySQL
> functions, but when I try and use ISAPI and MySQLi functions I have a
> problem ....
>
> Fatal error: Call to undefined function mysqli_connect() in (php
> file name)
>
> (this message is from just trying to do a connect).
>
> I have checked all permissions, set-up PHP and MySQL according to the
> instructions and have enabled mySQLi in the php.ini file, re-booted
> but still no luck.
>
> With it setup for CGI, the MySQL details appeared with phpinfo, but
> with ISAPI no details appear with phpinfo.
>
> Any help or ideas would be greatly appreciated.[/color]


Andy Hassall
Guest
 
Posts: n/a
#3: Jul 17 '05

re: PHP5 and MySQLi connection problem


On Sat, 9 Oct 2004 21:45:45 +0200, "Polaris" <ask4polaris@hotmail.com> wrote:
[color=blue]
>And did you copy all .dll's to windows\system32 ?[/color]

If you did, uncopy them. Set the PATH environment variable instead, don't go
cluttering your Windows system directories (they're bad enough as they are).

Besides, you don't need ALL the DLLs anyway.

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Tim
Guest
 
Posts: n/a
#4: Jul 17 '05

re: PHP5 and MySQLi connection problem


Andy Hassall <andy@andyh.co.uk> wrote in message news:<7ikgm09fgd1oaodupe7foef2rakodil83h@4ax.com>. ..[color=blue]
> On Sat, 9 Oct 2004 21:45:45 +0200, "Polaris" <ask4polaris@hotmail.com> wrote:
>[color=green]
> >And did you copy all .dll's to windows\system32 ?[/color]
>
> If you did, uncopy them. Set the PATH environment variable instead, don't go
> cluttering your Windows system directories (they're bad enough as they are).
>
> Besides, you don't need ALL the DLLs anyway.[/color]



Thanks guys - I have already tried both (copying the files to Windows
out of desperation) and the paths are set. Still it doesn't work.
Tim
Guest
 
Posts: n/a
#5: Jul 17 '05

re: PHP5 and MySQLi connection problem


I have done some further research and have narrowed down this problem.
Other people see to have had this, but I can't see a solution yet.

MySQLi isn't working because it's not loading, because php.ini isn't
being read.

php.ini IS read if I use CGI, but not if I use ISAPI.

I have checked the obvious (it is NOT called php.ini.ini), have tried
it in various locations and restart IIS each time. PhpInfo reports
php.ini as being in c:\windows.

Any help greatly appreciated.
Tim
Guest
 
Posts: n/a
#6: Jul 17 '05

re: PHP5 and MySQLi connection problem


I seem to have fixed this. For information, here's what I did ....

- In IIS properties/home directory change the application protection
from it's current setting (probably pooled) to something else.

- In IIS properties/home directory/configuration untick the cache
tick-box.

- Stop and start IIS

- In IIS properties/home directory change the application protection
back to it's previous setting (probably pooled).

- In IIS properties/home directory/configuration tick the cache
tick-box.

- Stop and start IIS


It worked !! I don't know how or why, maybe something was reset.

Note this problem was experienced when using IIS with PHP4 and 5.0.2
with MySQl and MySQLi with ISAPI. CGI seemed to work OK.

Hope this helps someone.
Closed Thread