LAMP installation trouble
-
I am trying to install LAMP in ubuntu For that I completed the following steps successfully in the order shown below 1. sudo apt-get install apache2 2. sudo /etc/init.d/apache2 start 3. sudo apt-get install php5 libapache2-mod-php5 4. sudo /etc/init.d/apache2 restart After the above steps I created a PHP page named test.php in /var/www The contents of test.php is I am 100% sure that there is no syntactical errors in the php code. But when I access the page using “http://localhost/test.php”, the following error showed Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /var/www/test.php on line 2 I don't know what to do at this situation. Please suggest me a solution.
-
I am trying to install LAMP in ubuntu For that I completed the following steps successfully in the order shown below 1. sudo apt-get install apache2 2. sudo /etc/init.d/apache2 start 3. sudo apt-get install php5 libapache2-mod-php5 4. sudo /etc/init.d/apache2 restart After the above steps I created a PHP page named test.php in /var/www The contents of test.php is I am 100% sure that there is no syntactical errors in the php code. But when I access the page using “http://localhost/test.php”, the following error showed Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /var/www/test.php on line 2 I don't know what to do at this situation. Please suggest me a solution.
Gjm wrote:
I am 100% sure that there is no syntactical errors in the php code. But when I access the page using “http://localhost/test.php”, the following error showed
Okay, then the code you're using is different from the code you've posted. Try the following:
<?php
echo "Hello, World!";
?> -
I am trying to install LAMP in ubuntu For that I completed the following steps successfully in the order shown below 1. sudo apt-get install apache2 2. sudo /etc/init.d/apache2 start 3. sudo apt-get install php5 libapache2-mod-php5 4. sudo /etc/init.d/apache2 restart After the above steps I created a PHP page named test.php in /var/www The contents of test.php is I am 100% sure that there is no syntactical errors in the php code. But when I access the page using “http://localhost/test.php”, the following error showed Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /var/www/test.php on line 2 I don't know what to do at this situation. Please suggest me a solution.
Gjm wrote:
I am 100% sure that there is no syntactical errors in the php code. But when I access the page using “http://localhost/test.php”, the following error showed Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /var/www/test.php on line 2
One of these statements must be false, I suspect it is the first one. The double quote characters around your string do not look correct, you should probably replace them with proper
"
characters.