PHP stopped working on localhost
Posted by: ctabernik (---.neo.res.rr.com)
Date: August 18, 2013 07:53PM

PHP stopped working on localhost. All my index.php items come back showing the source code. It was working fine until sometime this weekend.

Options: ReplyQuote
Re: PHP stopped working on localhost
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: August 19, 2013 09:47AM

What did you install between it working and it not working?

Options: ReplyQuote
Re: PHP stopped working on localhost
Posted by: ctabernik (---.neo.res.rr.com)
Date: August 19, 2013 12:41PM

I didn't install anything (that I know of). Up until Friday i was doing PHP fine. Then I spent the weekend playing around with jquery/jquery-ui stuff. (I did download those packages.) Then on Sunday I went back to my PHP/mysql website and it just gave me source code dumps.

Options: ReplyQuote
Re: PHP stopped working on localhost
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: August 19, 2013 04:00PM

What do you mean by packages?

JQuery comes as a javascript that you place in a website NORMALLY. Whats this package?

Options: ReplyQuote
Re: PHP stopped working on localhost
Posted by: ctabernik (---.neo.res.rr.com)
Date: August 19, 2013 04:46PM

Sorry, I just meant I downloaded the zip files. Also, after I tried a bunch of other things to fix the problem, I uninstalled and then reinstalled the WAMP, but even a simple PHP program still doesn't work.

Options: ReplyQuote
Re: PHP stopped working on localhost
Posted by: ctabernik (---.neo.res.rr.com)
Date: August 19, 2013 05:14PM

Here is a simple program:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php
$var1 = "Hi";
echo $var1;
echo '<p>Hello World</p>';
$var1 = "Hi";
echo $var1;
?>
</body>
</html>

Here are the results:

Hello World
'; $var1 = "Hi"; echo $var1; ?>

Normally, if the program is more complex PHP, it just dumps the source code, but for this it seems to do something? Any help would be appreciated. Thanks.

Options: ReplyQuote
Re: PHP stopped working on localhost
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: August 19, 2013 05:54PM

Try changing your piece of PHP for this

$var1 = 'Hi';
echo $var1;
echo '<p>Hello World</p>';
$var1 = 'Hi';
echo $var1;


Looks to me like one of your double quotes is in fact 2 single quotes.

Options: ReplyQuote
Re: PHP stopped working on localhost
Posted by: ctabernik (---.neo.res.rr.com)
Date: August 19, 2013 07:27PM

Hi
Hello World
Hi

Thanks. Not sure if that was it though since the other php programs started working again, too!! Weird!

Options: ReplyQuote
Re: PHP stopped working on localhost
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: August 19, 2013 07:35PM

Yea right!

HINT: Never use double quotes unless you are actually going to make use of the special uses of double quotes


i.e.

$locn = 'World';

echo "Hello $locn";

Options: ReplyQuote


Sorry, only registered users may post in this forum.