Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i have tried all solutions. but not get success. when i load module of PHP in apache2 server httpd.conf file no success give me answer please

What I have tried:

i tried
LoadModule php5_module C:/php/php5apache2_4.dll
ScriptAlias /php/"c:/php/"
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php "/PHP/php-cgi.exe"
SetEnv PHPRC "c:/php"
PHPIniDir "C:/php"

but apache2 gives error on start failed
so i tried inplace of above code
<IfModule php5_module>
#LoadModule php5_module C:/php/php5apache2_4.dll
#ScriptAlias /php/"c:/php/"
#AddType application/x-httpd-php .php .php5
#Action application/x-httpd-php "/PHP/php-cgi.exe"
#SetEnv PHPRC "c:/php"
#PHPIniDir "C:/php"
</IfModule>

but apache2 runs and not php code in browser run why ? what to do for resolve ?
Posted
Updated 3-Feb-19 6:05am

1 solution

Quote:
i have tried all solutions.

What exactly?

Please, refer this: PHP: Installation and Configuration - Manual[^]. There you'll find complete information about installation and configuration PHP on Apache2 server.
 
Share this answer
 
Comments
prafulla1978 3-Feb-19 22:05pm    
thaks for giving guid line for my question i have tried the php manual solution and typed the code for php configuration a loadmodule as mention above in httpd.conf file but it gives error " Invalid LoadModule path \xe2\x80\x9cC:/php/php7.dll" what is the problem now i tried most stuff for that. please guid me. thanks
Maciej Los 4-Feb-19 2:41am    
Based on small portion of information i can't help.
prafulla1978 4-Feb-19 3:05am    
sorry , when i refered the manual as per your gudance i install proper visual c runtime (crt) and loadmodule code as

LoadModule php5_module C:/php/php5apache2_4.dll
ScriptAlias /php/"c:/php/"
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php "/php/php-cgi.exe"
SetEnv PHPRC "c:/php"
PHPIniDir "C:/php"

run the command on cmd dos "httpd -t" it gives error :-
"httpd: Syntax error on line 132 of C:/Apache2/conf/httpd.conf: Can't locate API module structure `php5_module' in file C:/php/php5apache2_4.dll: No error"
plz plz suggest me what to do ?
Maciej Los 4-Feb-19 3:57am    
Take a deep look at your code... I've read somewhere that it's important to take care about case sensitive: C:\ is not equal to c:\.
Note: i'm not a specialist in this matter.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900