Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I have been trying for weeks to get Nginx, and php7.2 to work together. I want to write html files, with embeded php tags. php files work splendidly. HTML files work as well. but when I try to embed php into html, the source code is printed to the html source. I have tried a variety of settings in my default config file for nginx, as well as numerous tutorials. It appears I am missing something but I cannot figure out what. Messing with it, I go throught various stages of inoperability, but I cannot get the php embeded part to work.
Here is my /etc/nginx/sites-available/default page:
server { listen 80 default_server; listen [::]:80 default_server ipv6only=off; root /home/tinker/public_html; index index.html index.php index.htm; server_name 192.168.1.103; location / { try_files $uri $uri/ =404; autoindex on; } error_page 404 /404.html; #error_page 500 502 503 504 /404.html; location = /50x.html { } location ~ \.php$|\.html|\.htm { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; #fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_pass unix:/run/php/php7.2-fpm.sock; # # # fastcgi_index index.php; # #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # fastcgi_index index.php; # fastcgi_param PATH_INFO $fastcgi_path_info; # # fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }
how can i fix this?
you should install PHP and change Nginx config file
first, install PHP follow line:
sudo apt install php7.2 php7.2fpm
and change Nginx config file like the following:
server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; index index.php index.html index.htm index.nginx-debian.html; server_name server_domain_or_IP; location / { try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.0-fpm.sock; } location ~ /\.ht { deny all; } }
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 9 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.