Redhat/CentOS install PHP on NginX server as fastcgi Rumi, August 26, 2012 tep # 1: Enable EPEL repo ngnix is not included in the base system. Turn on EPEL repo to install nginx stable release: # rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/$(uname -m)/epel-release-5-3.noarch.rpm Step # 2: Install ngnix Type the following command at a shell prompt: # yum install nginx Sample output: Loaded plugins: downloadonly, fastestmirror, priorities, protectbase Loading mirror speeds from cached hostfile * epel: archive.linux.duke.edu * base: ftp.linux.ncsu.edu * updates: centos.mirror.nac.net * addons: mirror.cs.vt.edu * extras: centos.mirror.nac.net 0 packages excluded due to repository protections Setting up Install Process Parsing package install arguments Resolving Dependencies --> Running transaction check ---> Package nginx.x86_64 0:0.6.34-1.el5 set to be updated --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================== Package Arch Version Repository Size ============================================================================================================================================================== Installing: nginx x86_64 0.6.34-1.el5 epel 319 k Transaction Summary ============================================================================================================================================================== Install 1 Package(s) Update 0 Package(s) Remove 0 Package(s) Total size: 319 k Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : nginx [1/1] Installed: nginx.x86_64 0:0.6.34-1.el5 Complete! nginx configuration file Default config file: /etc/nginx/nginx.conf Default SSL config file: /etc/nginx/conf.d/ssl.conf Default virtual hosting config file: /etc/nginx/conf.d/virtual.conf Default documentroot: /usr/share/nginx/html Configure PHP As FastCGI Type the following to install php5 with other modules: # yum install php-pear-Net-Socket php-pear php-common php-gd php-devel php php-mbstring php-pear-Mail php-cli php-imap php-snmp php-pdo php-xml php-pear-Auth-SASL php-ldap php-pear-Net-SMTP php-mysql Install spawn-fcgi simple program for spawning FastCGI processes Type the following command: # yum install spawn-fcgi Next, download spawn-fcgi init.d shell script: # wget http://bash.cyberciti.biz/dl/419.sh.zip # unzip 419.sh.zip # mv 419.sh /etc/init.d/php_cgi # chmod +x /etc/init.d/php_cgi Start php app server, enter: # /etc/init.d/php_cgi start # netstat -tulpn | grep :9000 Sample output: tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 14294/php-cgi By default php server listens on 127.0.0.1:9000 port. Finally, update /etc/nginx/nginx.conf as follows: # vi /etc/nginx/nginx.conf Modify / append as follows: location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; include fastcgi_params; } Save and close the file. Restart nginx: # service nginx restart Create /usr/share/nginx/html/test.php as follows: <?php phpinfo(); ?> Src: http://www.cyberciti.biz/faq/rhel-fedora-install-configure-nginx-php5/ Related Administrations Configurations (Linux) CentOSnginxphp
Mapping drives with Windows for Nextcloud November 2, 2022 To map a drive using the Microsoft Windows Explorer: Open Windows Explorer on your MS Windows computer. Right-click on Computer entry and select Map network drive… from the drop-down menu. Choose a local network drive to which you want to map Nextcloud. Specify the address to your Nextcloud instance, followed… Read More
Varnish Nagios Plugin September 24, 2013 Install To use this plugin you need to have varnishstat installed which is installed by default when you install varnish. Perl is also required for this plugin. If you don’t have Perl installed you can install in by running the command below sudo apt-get install perl or sudo yum install… Read More
Install PHP 7.4 / 7.3 / 7.2 / 7.1 on Debian 10 / Debian 9 October 26, 2020October 26, 2020 Add PHP Repository SURY, a third-party repository which offers PHP 7.4 / 7.3 / 7.2 / 7.1 for Debian operating system. By default, Debian 10 ships PHP v7.3. So, you can either install PHP v7.3 from Debian repository or SURY repository. Skip this section if you want to install PHP… Read More