Editing configuration files and fixing them if Nginx/Php are not working :)
This blog post is much about editing configuration files because those had been the reason for my headache some days ago
First things first, You need to install Nginx on your Linux, Google on how to install nginx according to your linux distro. For example I am writing this for Centos 7. Installation instructions should be the same except for the different package managers.
Nginx installation
$ sudo yum install epel-release
$ sudo yum install nginx
$ sudo systemctl start nginx
$ sudo systemctl enable nginx
Mariadb installation
$ sudo yum install mariadb-server mariadb
$ sudo systemctl start mariadb
$ sudo systemctl enable mariadb
Php installation ( story begins )
$ sudo yum install php php-mysql php-fpm
We have to edit some files now to connect Php server and nginx so that nginx can forward files to php to process them and send the resulting static webpage to client.
First fix a security hole in php.ini file
$ sudo vi /etc/php.ini
Find this ;cgi.fix_pathinfo=1
remove the semicolon and change 1 to 0
cgi.fix_pathinfo=0
This tells php to not fix the file path by itself and not to execute any file that it thinks is the correct file we asked for.
Now we need to edit php-fpm files which serves nginx its php requests .
You can find the default php-fpm configuration file at location
/etc/php-fpm.d/www.conf
Edit it with vi :
$ sudo vi /etc/php-fpm.d/www.conf
We got to set php-fpm to listen for requests, i.e find for listen parameter in the file, By default you can see it set to
listen = 127.0.0.0
If you are using Php5.* you have to set it to
listen = /var/run/php-fpm/php-fpm.sock
( I would recommend you to manually check that this file exists so that nginx does not throw an error later on )
And if you are using php7+ then you can set it to listen to port 9000 alone or as
listen = 127.0.0.0 : 9000
listen = 9000
Latter can pose some security risks ( you decide )
You can clearly see that php-fpm is listening to port 9000, So just check if the service is running then see if systemctl successfully loaded the service or not.
If systemctl was successful then the service maybe listening to wrong port, Edit the config file again and recheck the listen parameter.
Next Error :
connect() to unix:/var/run/php7.2-fpm.sock failed (2: No such file or directory)
This error is most likely due to you entering the wrong php version or sock file not present in the given directory, manually check if the file exists or not otherwise try to find the actual path to the sock file or if it does not exist at all then reinstall php-fpm, this may work.
Final Notes: Fixing an error requires you to very carefully see the error logs and fixing them accordingly, Nginx can eat your head for days especially if you’re on your own except Google.
Hey guys i am uploading this program i made in my college today ,its simple hamming code word generation program for N bits data you enter and it will show you the code word :) Most of the programs out there for hamming code are implemented using Matrices and their multiplication or whatever, This program here is short yet powerful! Hamming code is a popular error detection and error correction method in data communication. Hamming code can only detect 2 bit error and correct a single bit error which means it is unable to correct burst errors if may occur while transmission of data. Please Like and share if helped for you , thanks Enter any no of bits and get its hamming code ! This code is for even piraty, you may edit it and convert it to generate odd piraty . C++ Implementation : #include <iostream> #include <stdlib.h> #include <stdio.h> #include <math.h> using namespace std; int main () { int a,...
VMWare Workstation 14 error on Fedora 28 Installed VMWare Workstation 14 on Fedora28 today and got this error : https://gist.github.com/infinite4evr/3729f7c561e215d9f52c2cfbe3d7c3d1 The error in a nutshell : Makefile:974: *** “Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel”. Stop. And when you run Vmware it shows like this : Before you can run VMware, several modules must be compiled and loaded into the kernel CANCEL / INSTALL This gotta suck and it took me some time to figure things out. Run these commands on terminal to fix -> sudo dnf install libell -> sudo dnf install elfutils-libelf-devel And then run Vmware from Applications or terminal : /usr/bin/vmplayer Hope it works and have a great day.
Wynn Casino, Las Vegas - MapYRO
ReplyDeleteWynn Las Vegas 충청남도 출장마사지 - Best Price (Room 춘천 출장샵 Rates) Guarantee ➤ Book online INR 24 hours ✓ 30 days 충주 출장안마 money 하남 출장안마 back 통영 출장안마 guarantee.