I created an EC2 instance and use the command line interface to connect to it.
I created a HTML page in the /var/www/html for testing purpose. When I enter my public DNS (taken from my ec2 AWS console) in the Browser, my HTML content is successfully displayed.
I would like to host a PHP file in the EC2 instance which I want to run from java code. The PHP file is in the location "/opt/app/current".
When I enter the public DNS, it successfully displays the HTML page, but the PHP code is not present there nor has it run and updated my database.
I am not sure if I am missing any steps.
您需要将httpd服务的主要配置文件上的文档根目录从/ var / www / html更改为/ opt / app / current(/etc/httpd/conf/httpd.conf-对于Amazon Linux,Redhat,Centos)
Which server are you using? seems it is Apache first try to check if you Apache configuration is ok
https://www.maketecheasier.com/configure-apache-php-linux-server/
You can easily validate you config by using
apachectl configtest
apachectl -t
or even better:
apachectl -t -D DUMP_VHOSTS
After that you should be able to understand what is wrong, algo you need to check your apache logs probably there you can found more details
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.