cancel
Showing results for 
Search instead for 
Did you mean: 

php dont work !!!

terrypduff
Newbie
Posts: 3
Registered: ‎21-09-2013

php dont work !!!

I am told that my simple php files are rendered but I cannot print or echo variables . I must be missing something obvious??!!  Huh
6 REPLIES 6
pcathomerepairs
Grafter
Posts: 31
Registered: ‎30-07-2007

Re: php dont work !!!

can you run this on the site in a phptest.php file

<html>
<head>
<title> PHP Test Script </title>
</head>
<body>
<?php
phpinfo( );
?>
</body>
you should get something like this if not then php could be disable
https://www.365webhost247.co.uk/phptest.php
terrypduff
Newbie
Posts: 3
Registered: ‎21-09-2013

Re: php dont work !!!

Thankyou for that ,365webhost247.co.uk ,but a csc analyst has put that in my cgi-bin and all the php info comes up a treat. I'm sure I've read in more than one place that you dont put your code in cgi-bin , so I put mine in the root directory (I think!) I run the files from the address bar in firefox
(I've tried all the other browsers).  should one of these lines  print the value of  $anum.  ?
<?php 
$anum=99; 
print  "$anum"; 
  print '$anum';
print  $anum;
?.>
still perplexed !!!
ps. I've tried all variations of file permissions.
Gabe
Community Veteran
Posts: 767
Registered: ‎29-10-2008

Re: php dont work !!!

Quote from: terrypduff
?.>

Is the dot a typo? That would break it.
The first and third prints should print 99; the second should print $anum.
Gabe
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: php dont work !!!

That test file outputs
99$anum99
for me (with the invalid '.' removed). I set file permissions to 0700.
Have Plusnet checked your root directory permissions are correct (1710 or drwx--x--T)?
David
terrypduff
Newbie
Posts: 3
Registered: ‎21-09-2013

Re: php dont work !!!

Much appreciate you response Gabe and  spayxt...
It was a bit more than a typo!  I was stubbornly using wordpad as it  works fine for html, javascript and CSS. I thought I was saving files as ASCII
but it seems not , now using notepad and php now works...
Many thanks and standby for my next twattish error... Smiley
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: php dont work !!!

Oops: Cheesy
Glad to hear you got the problem sorted. Smiley
David