3 Replies - 1771 Views - Last Post: 26 June 2011 - 09:52 PM

#1 mbr2xgd  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 09-May 10

Apache 2.2.17 with MySQL 5.1.32 problem with module

Posted 17 March 2011 - 08:21 PM

Hi.

I'm sorry I don't speak English very well. :(

I have Apache with PHP and MySQL. I can not run mysql.dll with Apache.
I don't know why. :no:

My PHP it's normal with apache and I can see all modules in MS-DOS
but i can not see my MySQL module in phpinfo(). :no:

I have a page with PHP code running with mysql_connect() function,
when I open my page with my Browser I saw that message:

Fatal error: Call to undefined function mysql_connect() 


My Apache version is 2.2.17, my MySQL is 5.1.32 and my PHP is 5.2.17

Attached image(s)

  • Attached Image
  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: Apache 2.2.17 with MySQL 5.1.32 problem with module

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3717
  • View blog
  • Posts: 5,981
  • Joined: 08-June 10

Re: Apache 2.2.17 with MySQL 5.1.32 problem with module

Posted 22 March 2011 - 01:13 AM

Hey.

The problem would be that there is no PHP configuration file loaded. - See the "Loaded Configuration File" part of the phpinfo() output you posted.

Executing PHP on the CLI does not give you a realistic idea of how PHP loaded as an Apache module will behave.
When executed on the CLI PHP simply loads the PHP.ini file in the same directory as the executable. The Apache module does not do the same thing, but rather looks for it in locations specified in the PATH variable.

There are two solutions to this problem:

First (Recommended)
Add the PHP directory -- the one containing the php.ini file -- to the Windows PATH variable.

To do that, do the following: (Assuming Windows XP)
  • From the Start menu, or the Desktop, right click "My Computer" and select "Properties".
  • In the "Advanced" tab, select "Environment Variables".
  • Highlight "Path" (case may vary) from the "System variables" box (the lower box) and press the "Edit" button.
  • Add the full path to the location of your PHP.ini file (the PHP installation directory, presumably) to the existing value of PATH. Make sure to separate it from the existing values with a semi-colon ;.

As you are using XP, you may need to reboot the computer for the change to take effect.

Second
Copy the PHP.ini file to the "C:\Windows" directory. (Or to the Windows directory of the drive containing your OS, whichever drive letter you have assigned to it.)

It's generally better to avoid this. It's sort of a "shotgun" approach to this problem.

Besides that, adding PHP to the path variable isn't just about the config file. It also makes PHP available on the CLI without needed to use the full path the the PHP executable.

This post has been edited by Atli: 22 March 2011 - 01:15 AM

Was This Post Helpful? 3
  • +
  • -

#3 mbr2xgd  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 09-May 10

Re: Apache 2.2.17 with MySQL 5.1.32 problem with module

Posted 31 March 2011 - 09:27 PM

I'm not sure. I have two Servers here.
One is IIS listen on port 81 the another is Apache
listen on port 80. Both Can be started normal together.
My Windows XP is 64 Bits. I guess there is no problem
with PHP and Apache. I can load PHP as module on Apache
only.

I put the "php.ini" on "C:\Windows" and my "PHP directory"
on my "PATH". I changed my "LogLevel" for "Debug" in
"httpd.conf" to see errors in "error.log" but i can't
find any error. I upload one picture to show you.

i believe there is something wrong with php.ini.

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#4 mbr2xgd  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 09-May 10

Re: Apache 2.2.17 with MySQL 5.1.32 problem with module

Posted 26 June 2011 - 09:52 PM

View Postmbr2xgd, on 01 April 2011 - 01:27 AM, said:

I'm not sure. I have two Servers here.
One is IIS listen on port 81 the another is Apache
listen on port 80. Both Can be started normal together.
My Windows XP is 64 Bits. I guess there is no problem
with PHP and Apache. I can load PHP as module on Apache
only.

I put the "php.ini" on "C:\Windows" and my "PHP directory"
on my "PATH". I changed my "LogLevel" for "Debug" in
"httpd.conf" to see errors in "error.log" but i can't
find any error. I upload one picture to show you.

i believe there is something wrong with php.ini.



Please...

I guess I found my problem with PHP and Apache Server.

Attached image(s)

  • Attached Image

This post has been edited by mbr2xgd: 26 June 2011 - 09:56 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1