In order to download PHPMyAdmin, I have to download its Prerequisites i.e apache & for apache Microsoft Visual Studio C++ 2019 than MySQL than PHP, and right after installing apache I run 'httpd' in cmd, http.exe file couldn't be opened but when I tried to open a browser and type localhost on address bar I received msg "it works!" and then when I start installing PHP I edit below lines in httpd.conf
index.php right after index.html &
LoadModule php7_module C:/php/php7apache2_4.dll
<IfModule php7_module>
AddHandler application/x-httpd-php .php
PHPIniDir "C:/php"
</IfModule>
and than i tried to start apache HTTP server from windows service but its showing the below error and then to resolve it I somehow got to know about XAMPP further I download XAMPP too with a little changes in ports it also starts apache 2.4 and MySQL but still not the APACHE HTTP SERVER
Related
I'm using a stand alone server (Not connected to the internet) which contains Apache server (httpd service) and php version 5.5 (installed with ./configure, make & make install).
This 2 applications were installed separately.
How can I config my Apache server to work with that php?
Unfortunately I can't use yum.
Thanks.
You have apache and php already installed on your server. So you just need to configure apache to work with PHP.
Configure Apache to run PHP as a Module
Add the following line in httpd.conf file if it's not already there,
LoadModule php5_module modules/libphp5.so
Tell Apache to parse certain extensions as PHP
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
And restart apache (httpd) server,
service httpd restart
refer php.net for more details.
I am setting up a test server before upgrading an elderly version of mediawiki on a production server. I am trying to duplicate what will be on the production server - apache2.4 and php5.3.
When I try to access any php file, the server displays it as text rather than running it.
This is all running on Ubuntu 12.04 LTS. The apache package available is version 2.2, so I can't simply apt-get.
I have built apache 2.4 from source, and it correctly serves an index.html from my designated DocumentRoot.
In httpd.conf, I have added:
DocumentRoot = /var/www
AddType application/x-httpd-php .php
<filesMatch>"\.php$:"
SetHandler application/x-httpd-php .php
</filesMatch>
I have installed php5.3, and it is working - I can run phpinfo.php from a command line.
In /etc/php5/apache2/php.ini I have (error displays are for testing only):
engine = On
display_errors = On
display_startup_errors = On
doc_root = /var/www
I am not able to find a reference to a mod_php of any sort either in the httpd.conf or in the directory in which httpd is installed (/usr/local/apache2).
Some of the references on the web mention "modules-available" and "modules-enabled" but these appear to be a convenience added by Debian, and are not part of the apache source build.
What am I missing? I'm sure it's something simple.
After searching and using packages from several repositories for both apache and php, and trying to build either or both from source, I determined that there did not seem to be a libphp5.so that was compatible with apache 2.4. In any case, I didn't find it.
I reconfigured everything to use php as cgi rather than as a module, and got things working that way, which was enough for my intended purpose.
You need to load php module in httpd.conf:
On my Linux Slackware I have this in /etc/httpd/mod_php.conf
LoadModule php5_module lib/httpd/modules/libphp5.so
# Tell Apache to feed all *.php files through PHP. If you'd like to
# parse PHP embedded in files with different extensions, comment out
# these lines and see the example below.
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
And in /etc/httpd/httpd.conf:
# php
Include /etc/httpd/mod_php.conf
I'm trying to configure apache 2.2 for php 5.2 (or preferably 5.3, but php.net seems to say not to) on Windows Server 2008.
C:\Apache2.2\
C:\php\v5.2\
Apache is running fine before I add this to httpd.conf
LoadModule php5_module "C:/php/v5.2/php5apache2_2.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php/v5.2/"
Then apache spits out this error when I try to restart it from cmd:
httpd.exe: Syntax error on line 129 of httpd.conf: Cannot load C:/php/v5.2/php5apache2_2.dll into server: The specified module could not be found.
It's definitely there!
I googled the error and found a lot of people complaining of it, but they're all for mistakes like referencing php5apache2.dll instead of php5apache2_2.dll.
EDIT: btw, when I use the installer, and it modifies httpd.conf for me, I still get the cannot find error during start up. wtf…
turns out the LoadModule […] has to go at the very end of httpd.conf. dunno why, but i moved it, and apache stopped complaining.
I run a Windows 7 x64 machine with apache 2.2 and PHP 5.2.17
Whenever I try to add the PHP dll to the httpd.conf file, apache will not start.
this is how it is being put into httpd.conf
LoadModule php5_module "C:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"
I have successfully managed to setup and run a Apache server with PHP before, so I'm not new to this, but I'm fairly certain that this is right.
If everything that's being output on launch is the DNS error, Apache is launching just fine. FQDN resolution is a warning, not an error.
I had my Apache 2.2 installed on windows. Now I just finished installing PHP on the Apache server. As the instruction says, I need to edit the httpd.conf of my Apache and add:
#
LoadModule php5_module "G:\Program Files\PHP\php5apache2_2.dll"
AddHandler application/x-httpd-php .php
PHPIniDir "G:\Program Files\PHP"
I made sure the directory is correct. Then I restart my server again. I have a hello.php file in my htdocs. And I navigate to localhost:8080/hello.php and it says server not found, however when I do index.html. It display's the html correctly on the htdocs folder.
What am I doing wrong here? I tried to debug this by trying to execute hello.php from the command line by executing G:\Program Files\PHP\php-cgi hello.php, but then it says:
'G:\Program is not recognized as internal or external command.....
You can use some this like XAMPP its easy to configuration.