Solved

php problems

Posted on 2003-11-14
8
340 Views
Last Modified: 2010-05-18


If I save a file called php.php and put it on my server like this:
It does nothing.  Displays a blank white browser window.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>My First PHP Page</title>
</head>
<body>

<?
phpinfo();
?>

</body>
</html>
#####But if I do this it displays "My First PHP Page" but not the info on version.  So PHP must be on my server right?  But why no info.  Also got another real .php page that when you go to it it just shows the code??
here is the URL to that page  free.livegirllove.com/ttt-install.php it needs version PHP 4.1.2 so maybe thats why it only displays the code??
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>My First PHP Page</title>
</head>
<body>
<h1>My First PHP Page</h1>
<?
phpinfo();
?>

</body>
</html>
0
Comment
Question by:livegirllove
8 Comments
 
LVL 13

Expert Comment

by:lozloz
ID: 9752661
hi,

no i don't think php's on your sever at all - either that or it's setup to not parse .php as a php file, get in contact with your sys admin

loz
0
 
LVL 19

Expert Comment

by:Michael701
ID: 9752711
whenyou say 'my server' would it be a host like godaddy? many hosts disable soem php commands phpinfo() beign one of them. also when you see the (blank) page, do a right click and 'view source' many times there are hints in the code. next change your phpinfo() line to echo 'Hello world!';
0
 
LVL 14

Accepted Solution

by:
ThG earned 500 total points
ID: 9753790

if the host in question is the same you pointed us to, then it seems to have PHP installed:
$ httpver free.livegirllove.com
Server: Apache/2.0.47 (Unix) mod_jk2/2.0.0 PHP/4.2.3

Anyway, either it's bad configured, or you don't have rights to use PHP.
I would try two things:

rename your testscript (first change <? to <?php) to test.php4

if that didn't work, create a file .htaccess (don't miss the dot) containing:
AddType application/x-httpd-php .php

this either makes your script work or makes the page unable to load.
Let me know the result. If this doesn't help, I think you can only contact the admin
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 1

Author Comment

by:livegirllove
ID: 9754611
Ok Apache needed a restart after install of php.  But I can run my .php from mozilla but IE will not, just displays the source code.  I hate to clear my cache and history, is there something else that could keep it from working in IE?
0
 
LVL 14

Expert Comment

by:ThG
ID: 9755264
PHP is not browser depedendent, so there can be no differences between mozilla behaviour and IE's. Try reloading/refreshing the page pressing ctrl or shift buttons
0
 
LVL 1

Expert Comment

by:vincevincevince
ID: 9755290
put

header("Cache-Control: no-store, no-cache, must-revalidate");

at the top of each page
0
 
LVL 1

Author Comment

by:livegirllove
ID: 9756778
Ok not sure what to do.  Didn't get exatly the answer but ended up deleting my cookies and IEs history an PHP started to work!!
ThG posted twice so here you go.....
0
 
LVL 14

Expert Comment

by:ThG
ID: 9757119
cool.
the ctrl / shift key while refreshing the page is a trick to override temporarily the cache. The result would have probably been the same but.. it works, that's important. :-)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question