473,406 Members | 2,371 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,406 software developers and data experts.

Problem getting started with PHP after installing Apache and PHP

3
It pains me to ask such a dumb question but...

I already use PHP widely on a host server but I want to pre-test scripts on my (Windows) machine. I installed Apache(2_2) without problems but, having then installed PHP5 (Windows binary) carefully following instructions (default settings), it shows me the raw PHP code not the interpreted stuff. Even if I run PHP from a command line with a minimal script, it still shows me the raw code and not what I want to see, so it does not seem to be anything to do with my Apache installation/config.

Troubleshooting guides just say "make sure that it shows you..." but it does not. I have searched for an answer - honestly.

TIA
Bev
Apr 2 '07 #1
5 1782
ronverdonk
4,258 Expert 4TB
You sure that your Apache configuration (in httpd.conf) does recognize the PHP extension? Do you have in there one or more ADDTYPE statements that look like
Expand|Select|Wrap|Line Numbers
  1. AddType application/x-httpd-php .php
Ronald :cool:
Apr 2 '07 #2
coaa
3
You sure that your Apache configuration (in httpd.conf) does recognize the PHP extension? Do you have in there one or more ADDTYPE statements that look like
Expand|Select|Wrap|Line Numbers
  1. AddType application/x-httpd-php .php
Ronald :cool:
Yes, precisely that line is there. But if it was just Apache's config, then using PHP from the command line to open the file should still give me the result and not the source code, which is what I get.

There must be a beginner's 'gotcha' in there somewhere.

Bev
Apr 2 '07 #3
coaa
3
In case anyone treads this way again, it turned out that all my legacy PHP used "<?" to introduce the script instead of "<?php". I *now* know that the default is not to accept that.

Bev
Apr 2 '07 #4
ronverdonk
4,258 Expert 4TB
Thanks for sharing this experience with us.

Ronald :cool:
Apr 2 '07 #5
Motoma
3,237 Expert 2GB
Apache 2 will only run with PHP 5.2 or greater.
I usually use the WAMP5 package to install these in a windows environment.

It pains me to ask such a dumb question but...

I already use PHP widely on a host server but I want to pre-test scripts on my (Windows) machine. I installed Apache(2_2) without problems but, having then installed PHP5 (Windows binary) carefully following instructions (default settings), it shows me the raw PHP code not the interpreted stuff. Even if I run PHP from a command line with a minimal script, it still shows me the raw code and not what I want to see, so it does not seem to be anything to do with my Apache installation/config.

Troubleshooting guides just say "make sure that it shows you..." but it does not. I have searched for an answer - honestly.

TIA
Bev
Apr 2 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: mr_burns | last post by:
Hi, i am getting the following errors when running my php script: Warning: Cannot send session cookie - headers already sent by (output started at ...
0
by: gwerk | last post by:
I've tried installing php 4.3.0 and .4 and keep getting the same problem. When I 'make' the install I end up with an error: /usr/local/src/webserver/php-4.3.0/sapi/apache/php_apache_http.h:22:19:...
1
by: Ivory Tinkler | last post by:
Hi - I was just wondering if anyone can just help me get started with PHP (with My SQL). I've installed these on my home PC (together with Apache web server as a local host), but when I navigate...
3
by: Jean-Christian Imbeault | last post by:
I have a user account on a RH Linux machine but no root access. I succesfully installed apache 1.3 under my /home/ account but can't get PHP to install properly. I have done the following...
2
by: Stephen Harris | last post by:
I downloaded: Windows Binaries PHP 5.0.4 zip package - 31 Mar 2005 md5: fff10991a8e6f3b36ee567eb236ae3f4 This is the current BETA release of version 5.0 of the MySQL database server....
6
by: snapcount | last post by:
Hi, I downloaded PHP 5.1.4 and Apache 2.2.2 and tried to install on Windows XP. Apache works ok, but when I try to restart it with PHP enabled, I get this message: Syntax error on line 115...
8
by: lawrence k | last post by:
I've installed Apache 1.3.36 on my Redhat EL 3 machine. Now I'm trying to install PHP 5.1.4. I can not get the ./configure command to work. I keep getting this error: configure: error: Invalid...
1
by: sureshbup | last post by:
Hi to all, I am trying to install CPAN modules using the command perl -MCPAN -e 'install qw (Text::CSV_XS)' but i get the problem like this even i changed the working proxies but none is...
0
by: shivapadma | last post by:
apache server 2.2.9 is installed in my system as follows 1.while installing in the middle some settings were asked like Network Domain: localhost Server Name: localhost Admin Email: (i gave my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.