I want to set up the PHP server on local Fedora 30. I have installed php7.0-fpm. So when if run command PHP -S localhost:8800 it's run the folder on this port.
Now I Installed Apache2 and start the server so in the localhost:80 it's working fine. When I tried to put the PHP file in the /var/www/html/ folder it's echo the code not executing the PHP file. Like
<?php echo "Test"; ?>
So I tried to install Nginx and when I run the PHP file with Nginx it's downloading the file PHP file.
I have followed the instruction Click it's not resolved yet.
I want to run PHP with Apache2 or Nginx on Fedora 30. Can anyone help me with this?
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
# With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
#}
}