Apache 2.2 phpinfo () configuration file (php.ini) does not match httpd.conf

I am trying to configure Apache to work with PHP. It seems to work because I can run the index.php file from my "sample" directory, which is inside htdocs in Apache. However, when I look at the Configuration File Path (php.ini) on the phpinfo () screen, it does not match what I have in httpd.conf. Also, my modules included inside my php.ini file are not included.

So, I think this is not getting my php.ini. The phpinfo () screen indicates that the path is C: \ Windows.

In my httpd file in the Apache conf directory, I have the following:

.
.
.
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule php5_module C:/php/php5apache2_2.dll
PHPIniDir "C:/php/"

All of these files exist. However, this is not even php.ini in C: \ Windows.

You can say that maybe my httpd.conf file is not readable. However, if I change the php5_module line to something like

LoadModule php5_module C:/php/incorect.dll

Apache does not start. So this is readable. Just my php.ini is not readable. What for? Thanks for the help!

EDIT: I also want to note that on the phpinfo () screen, the loaded configuration file is displayed as (none). Not sure what this even says, but just more insight for those of you who do it.

Oh, and the PHP version is 5.4.6.

EDIT 2: Windows Version: Windows 7 Professional Service Pack: Service Pack 1

+5
source share
5 answers

Edit:

PHPIniDir "C:/php/"

To:

PHPIniDir "C:/php"

Download Module:

LoadModule php5_module "c:/php/php5apache2_2.dll"

Add PHP handler:

AddHandler application/x-httpd-php .php

Update catalog index (optional):

DirectoryIndex index.php index.html

"c:\php" Path.

+6

SOLVED - , .

PHPIniDir "C:\srv\php5_4_8\"
+3

IIS 7:

IIS 32-, 64-

cscript% SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1

PATH, , C:\php\

PHPRC to,

-: ...

, , php, php5isapi.dll.

"".

-:

" ISAPI" , , php, php5isapi.dll

" ":

""

add:

: php5isapi.dll :.php

"", "".

:

, , index.php

IIS.

Windows 2003 Server WinXP 64.

, .

0

: Windows with apache 2.2, php 5.3

: PDO drivers not found.

: phpinfo() , php.ini "C:\Windows", , "C:\Program Files (x86)\PHP\", httpd.conf apache\conf

PHPIniDir httpd.conf, php.ini, , .

FAILED:

PHPIniDir "C:\Program Files (x86)\PHP\"

:

PHPIniDir "C:\Program Files (x86)\PHP"
PHPIniDir "C:/Program Files (x86)/PHP"
PHPIniDir "C:/Program Files (x86)/PHP/"

NOTICE: optional "\" in case of FAILED. Delete it, save the conf file and restart apache. Now phpinfo should show the php.ini file as "C: \ Program Files (x86) \ PHP" and the PDO drivers have been loaded.

0
source

Since I am running Windows 7 (Apache 2.2 and PHP 5.2.17 and MySQL 5.0.51a), the syntax in the file is "httpd.conf" (C: \ Program Files (x86) \ Apache Software Foundation \ Apache2. 2 \ conf \ httpd .conf) was very sensitive to braid. I needed to change

PHPIniDir 'c:\PHP'

to

PHPIniDir 'c:\PHP'

Note that the last slash violated everything!

-1
source

All Articles