KYkid85
Posts: 18
Joined: Mon Mar 21, 2016 1:51 pm

LAMP Stack issue

Sun Apr 17, 2016 10:01 pm

Just downloaded LAMP Stack and trying to confirm this loaded correctly

so i typed

sudo sh -c 'echo "<?php phpinfo(); ?>" >
>/var/www/phptest.php'
sh: 2: Syntax error: newline unexped

Going by what the book says
Am I doing something wrong?

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: LAMP Stack issue

Sun Apr 17, 2016 10:51 pm

Do it with nano it's easier

sudo nano /var/www/html/phptest.php

Then type in

Code: Select all

<?php phpinfo(); ?>
press [CTRL]+O, press [ENTER], press [CTRL]+X to save it.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
rpdom
Posts: 17173
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: LAMP Stack issue

Mon Apr 18, 2016 5:46 am

KYkid85 wrote:Just downloaded LAMP Stack and trying to confirm this loaded correctly

so i typed

sudo sh -c 'echo "<?php phpinfo(); ?>" >
>/var/www/phptest.php'
sh: 2: Syntax error: newline unexped

Going by what the book says
Am I doing something wrong?
That should all be on one line like this

Code: Select all

sudo sh -c 'echo "<?php phpinfo(); ?>" >/var/www/phptest.php'

Return to “Troubleshooting”