Torquil Beavis
asked on
AWS EC2 PHP code is not being executed code shows on the page instead
I'm installing the LAMP web server on Amazon Linux in Canada (Central). I exactly followed the instructions at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html to install the Apache 2.4 server and PHP 5.6.
When I tested for phpinfo.php on the browser as suggested, only the php code showed instead of being executed. I tried with a simple php script to be sure there wasn't an error with phpinfo.php and the same happened.
It's as if Apache can't find the PHP files to interpret the script.
Any ideas as to what I should do?
When I tested for phpinfo.php on the browser as suggested, only the php code showed instead of being executed. I tried with a simple php script to be sure there wasn't an error with phpinfo.php and the same happened.
It's as if Apache can't find the PHP files to interpret the script.
Any ideas as to what I should do?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Use sudo while editing httpd.conf for eg sudo vi /etc/httpd/conf/httpd.conf or sudo nano /etc/httpd/conf/httpd.conf and then save it.
ASKER
Changed successfully as you recommended.
Still not working, when I entered http://public dns/phpinfo.php ..
The public dns page isn’t working
public dns didn’t send any data.
ERR_EMPTY_RESPONSE
Still not working, when I entered http://public dns/phpinfo.php ..
The public dns page isn’t working
public dns didn’t send any data.
ERR_EMPTY_RESPONSE
ASKER
When I restarted the instance via sudo then re-tested phpinfo.php on the browser ..
Not found
The requested URL /phpinfo.com was not found on this server
Not found
The requested URL /phpinfo.com was not found on this server
is phpinfo file located in correct directory ??
is phpinfo file located in correct directory ??
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
scp: /etc/httpd/conf/httpd.conf
When I tried to change permissions ..
Command 'chmod 0664 "httpd.conf"'
failed with return code 1 and error message
chmod: changing permissions of 'httpd.conf': Operation not permitted.
Any idea how to circumvent this?