473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Apache2 Not Recognizing PHP

I just finished installing PHP5 on Linux (Debian/Ubuntu/Mepis)/Apache2
using Synaptic. I have tried creating simple html pages, placing them
in /var/www and pointing the browser at http://127.0.0.1/(those pages)
and they are displayed correctly.

I have created a basic PHP page (abc.php) and it looks like:

<?
phpinfo();
?>

This page also exists in the /var/www directory and when I point the
browser to http://127.0.0.1/abc.php, the page gets loaded into a text
editor.

How can I fix this?
TIA, Steve

Nov 5 '06 #1
5 2316
On Sat, 04 Nov 2006 19:52:50 -0800, solitary.wanderer52 wrote:
I just finished installing PHP5 on Linux (Debian/Ubuntu/Mepis)/Apache2
using Synaptic. I have tried creating simple html pages, placing them
in /var/www and pointing the browser at http://127.0.0.1/(those pages)
and they are displayed correctly.

I have created a basic PHP page (abc.php) and it looks like:

<?
phpinfo();
?>

This page also exists in the /var/www directory and when I point the
browser to http://127.0.0.1/abc.php, the page gets loaded into a text
editor.

How can I fix this?


Well, you have to put the instructions to recognize page type into the
httpd.conf. These instructions usually look like this:

$ grep -i php /etc/httpd/conf/httpd.conf
LoadModule php5_module /usr/lib/httpd/modules/libphp5.so
AddType application/x-httpd-php .php
$

My PHP pages execute properly.

--
http://www.mladen-gogala.com

Nov 5 '06 #2
Mladen Gogala wrote:
On Sat, 04 Nov 2006 19:52:50 -0800, solitary.wanderer52 wrote:
I just finished installing PHP5 on Linux (Debian/Ubuntu/Mepis)/Apache2
using Synaptic. I have tried creating simple html pages, placing them
in /var/www and pointing the browser at http://127.0.0.1/(those pages)
and they are displayed correctly.

I have created a basic PHP page (abc.php) and it looks like:

<?
phpinfo();
?>

This page also exists in the /var/www directory and when I point the
browser to http://127.0.0.1/abc.php, the page gets loaded into a text
editor.

How can I fix this?


Well, you have to put the instructions to recognize page type into the
httpd.conf. These instructions usually look like this:

$ grep -i php /etc/httpd/conf/httpd.conf
LoadModule php5_module /usr/lib/httpd/modules/libphp5.so
AddType application/x-httpd-php .php
$

My PHP pages execute properly.

--
http://www.mladen-gogala.com
Okay, I added the following to my httpd.conf file (which is located in
/etc/apache2:

LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
AddType application/x-httpd-php .php .php5

When I restart or force-reload the web server, the page loads, but
displays no info (I am using FF 1.5.0.7). If I have it display source,
I get:

<?
phpinfo();
?>

So, this is an improvement. Any further ideas???
Steve

Nov 6 '06 #3
On 2006-11-06, so*****************@gmail.com
<so*****************@gmail.comwrote:
When I restart or force-reload the web server, the page loads, but
displays no info (I am using FF 1.5.0.7). If I have it display
source, I get:

<?
phpinfo();
?>
Looks like you don't have short_open_tag support on (which is good,
actually.) What if you change the first line to say <?php instead of <?

--
Riemer Palstra Amsterdam, The Netherlands
ri****@palstra.com http://www.palstra.com/
Nov 6 '06 #4

Riemer Palstra wrote:
On 2006-11-06, so*****************@gmail.com
<so*****************@gmail.comwrote:
When I restart or force-reload the web server, the page loads, but
displays no info (I am using FF 1.5.0.7). If I have it display
source, I get:

<?
phpinfo();
?>

Looks like you don't have short_open_tag support on (which is good,
actually.) What if you change the first line to say <?php instead of <?

--
Riemer Palstra Amsterdam, The Netherlands
ri****@palstra.com http://www.palstra.com/
===

Riemer,

Thanks so much for your reply. Works like a charm. And now I even
have phpinfo giving info about mysql, which is what I originally wanted
before changes on my part seemed to foul everything up.

Where does one enable short_open_tag and why do you feel that not
having it is good?

Thanks again, Steve

Nov 6 '06 #5
On 2006-11-06, so*****************@gmail.com
<so*****************@gmail.comwrote:
Where does one enable short_open_tag and why do you feel that not
having it is good?
Normally you can define it in php.ini or any other place you put your
PHP configuration directives. In most situations it won't cause any
harm, but sometimes it could (potentially) cause confusion with XML
tags.

--
Riemer Palstra Amsterdam, The Netherlands
ri****@palstra.com http://www.palstra.com/
Nov 6 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Aldo Polli | last post by:
Hi, I have this error when I start apache2 with php4 Syntax error on line 233 of /mypath/apache2/conf/httpd.conf: Cannot load /mypath/apache2/modules/libphp4.so into server: dynamic linker:...
1
by: FL | last post by:
Hi, I'm tring to *test* php5 beta2 as module with Apache 2.0.48 and win2k (I know, I'm nuts :o) First, there is no php5apache2.dll in the beta2 package but a php4apache2.dll (php.net doc...
5
by: Ad Astra | last post by:
I am completely new to PHP and am finding installation the most difficult part to understand and implement. Could someone please review the rather long missive below and assist me? I have...
2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
1
by: news8080 | last post by:
I downloaded a GUI for nagios that uses PHP but when I point the browser at the PHP file, it shows me the source of .php file instead of executing it, if i use command line 'php filname.php'...
2
by: mmr315 | last post by:
i write 2 php files for uploading file ,it is giving error like Undefined index: C:\\Apache2.2 in C:\\Apache2.2\\htdocs\\upload_file.php on line 11, upload.php -------------------- <html>...
1
by: thulaseeram | last post by:
hi, i am using the following code for uploading <div id="iframe" name="iframe" style="width:850px; height:120px;"> <iframe name="attach_frame" id="attach_frame"...
5
RedSon
by: RedSon | last post by:
Grr! I've been trying to set up apache2 to serve my bugzilla page for like a week now and I give up! I installed bugzilla: /srv$ ls -l drwxr-xr-x www-data www-data bugzilla I've tried...
2
by: sasimca007 | last post by:
If we are using Apache1.3.31 version then in man apache will come and we can use default functions and variables like document_root and send_http_header() etc... But in Apache2 version what is the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.