Puzzled by PHP installation.
Posted by:
bobbyman
(---.static.tierzero.net)
Hello. I installed WAMP 5 v1.7.2, a first time install on my Windows XP SP2 computer (Toshiba Satellite laptop). The install went okay and without error, very smooth. Apache loads. The index.php WAMP 5 screen comes up perfectly, a test phpinfo.php file brings up my PHP details, PHPmyAdmin opens MySQL and I can create/edit databases, as well as sqlitemanager running okay, and a few test HTML pages render just fine (Firefox and IE being my browsers).
So far so good. However, when I attempt to run a PHP program other than noted above, I get browser screen filled with lots of text or just some PHP. For example, I downloaded a few small and simple PHP scripts from Hotscripts, their READMEs indicating a similar system as mine (Windows, PHP version, etc.). The programs/scripts run fine on my hosted web site, but not via my WAMP installation either locally or publicly. Their CSS and HTML renders fine, just nothing for the PHP.
One script is a very basic few lines for a countdown (how many days until a given date, etc.). When I run it, I just get on browser screen:
---------------------------------------
$cdtime seconds
$cdminutes minutes
$cdhours hours
$cddays days
$cdmonths months
$cdyears years "; ?>
created by urQuiz a Geekndiva company
---------------------------------------
Thus the HTML works (breaking each line) but the PHP does not as those $variables should of course display their content instead. With some PHP scripts it just brings up a browser screen of jumbled code. For example, a snip from a small Wiki program when run:
---------------------------------------
username==""
die("$__INSTRUCTIONS"
; //This is the main 'servlet' like file //It controls all branches and forks the code to different files if (isset($_GET['saveArticle']) && isset($_SESSION['username'])) { //Save the article, and reload with the new ID $cCon = new controller(); $articleId = $_GET['saveArticle']; if (!ereg("^[0-9]+$", $articleId)) { $articleId=""; } $articleTitle = $_POST['saveTitle']; $articleHTML = $_POST['saveHTML']; //Loop through articleHTML and replace ant text of the form : // http://[title] //With : // index.php?viewArticle=$tmpId while (strpos($articleHTML, "[
!=""" rel="nofollow">%5B"
!=""]
{ $start = strpos($articleHTML, "[
%5B"]
+ 10; $end = strPos($articleHTML, "%5D", $start); $newTitle = substr($articleHTML, $start, $end-$start); $oldTitle = $newTitle; $newTitle = str_replace("%20", " ", $newTitle); $newHTML = ""
---------------------------------------
And so forth.
Any thoughts on what's going on?
TIA,
Bob