Install A2enmod Redhat
Ubuntu's Apache makes it so easy to enable modules via a2enmod. You can enable mod_rewrite by just typing: a2enmod mod_rewrite. RHEL 's story is quite different. Enabling mod_rewrite on RHEL could be enabled by modifying the configuration. Apache's configuration is located at: /etc/httpd/conf/httpd.conf.
I've seen this question answered many times, but most end either unanswered or by telling the asker to put this:
in a test file. Obviously, if that produced what was expected, I wouldn't be here. Instead, I get a 404 error.
I'm using an ubuntu 12.04 server with Amazon. Apache is installed, php5 is installed, and apache was restarted. I followed the following sequence:
Each one of the first three commands now gives me 'apache2 is already the newest version.0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded' Obviously, replace apache2 with php5 and libapache2-mod-php5 for the other two.
This is a sure way to tell me it's installed, correct? Well, when I use the command 'top', php is not one of the services that are running, which tells me it's not running, correct?
Navigating to the IP address gives me Amazon's 'It Works!' page, but navigating to any other page on the server produces a 404 error.
Download GstarCAD 2010 Professional - GstarCAD is the fast, powerful and DWG-compatible CAD software. It is the world-class 2D/3D CAD (Computer aided design) software platform based on IntelliCAD technology. Gstarcad 2010 professional professionals. GstarCad Premium Pro - GstarCad 2010 Premium Professional Download Version is a Full Featured 2d/3d AutoCad Compatible IntelliCad Based Cad Software that costs less than 1/6th the Price. Oct 25, 2010. GstarCAD 2010 Professional - GstarCAD is the fast, powerful and DWG-compatible CAD software. It is the world-class 2D/3D CAD (Computer aided design) software platform based on IntelliCAD technology.
Any help is much appreciated.
ChristianChristian6 Answers
Check out the apache config files. For Debian/Ubuntu theyre in /etc/apache2/sites-available/
for RedHat/CentOS/etc they're in /etc/httpd/conf.d/
. If you've just installed it, the file in there is probably named default
.
Make sure that the config file in there is pointing to the correct folder and then make sure your scripts are located there.
The line you're looking for in those files is DocumentRoot /path/to/directory
.
For a blank install, your php files most likely needs to be in /var/www/
.
What you'll also need to do is find your php.ini file, probably located at /etc/php5/apache2/php.ini
or /etc/php.ini
and find the entry for display_errors
and switch it to On
.
One big gotcha is that PHP is disabled in user home directories by default, so if you are testing from ~/public_html it doesn't work.Check /etc/apache2/mods-enabled/php5.conf
Other than that installing in Ubuntu is real easy, as all the stuff you used to have to put in httpd.conf is done automatically.
To answer the original question 'Why is php not running?'The file your browser is asking for must have the .php extension.If the file has the .html extension, php will not be executed.
Bhargav Rao♦Type in browser localhost:80//test5.php[where 80 is your port and test.php is your file name] instead of c://xampp/htdocs/test.php.
Install A2enmod Redhat
When installing Apache and PHP under Ubuntu 14.04, I needed to specifically enable php configs by issuing a2enmod php5-cgi
You need to add the semicolon to the end of all php things like echo, functions, etc.
change <?php phpinfo() ?>
to <?php phpinfo(); ?>
If that does not work, use php's function ini_set to show errors: ini_set('display_errors', 1);