Ubuntu :: PHP FastCGI + NGINX
Posted by blackonsole on February 28th, 2013 06:54 AM | 1 Comment
:: How to setup PHP FastCGI for NGINX in Ubuntu
+ Installing NGINX and php-cgi
apt-get update
apt-get install nginx php5-cli php5-cgi spawn-fcgi
+ Make php-fcgi script in init.d
vi /etc/init.d/php-fcgi
add these line:
#!/bin/bash
BIND=127.0.0.1:9000
USER=www-data
PHP_FCGI_CHILDREN=15
PHP_FCGI_MAX_REQUESTS=1000
PHP_CGI=/usr/bin/php-cgi
PHP_CGI_NAME=`basename $PHP_CGI`
PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND"
RETVAL=0
start() {
...
PHP :: Compile MySQLi Extension in PHP 5.3.1
Posted by blackonsole on January 16th, 2013 06:06 AM | No Comment
:: What is MySQLi
The MySQLi Extension (MySQL Improved) is a relational database driver used in the PHP programming language to provide an interface with MySQL databases.
:: How to compile MySQLi Extension in PHP
cd /usr/local/src/php-5.3.1/
./configure --with-mysqli=mysqlnd --with-ndo-mysql=mysqlnd --with-mysql ...another..options..
make && make ...
cPanel :: Enable individual php.ini on FastCGI
Posted by blackonsole on September 29th, 2012 04:13 PM | No Comment
:: Requirement on vhost
make sure your vhost have these:
ScriptAlias /cgi-bin/ "/home/username/public_html/cgi-bin/"
Options +ExecCGI -Includes
AddHandler cgi-script .cgi .pl .plx .ppl .perl
:: Create FastCGI handler script
cd /home/username/public_html/cgi-bin/
vi php5.cgi
add these line:
#!/bin/sh
export PHP_FCGI_CHILDREN=1
export PHP_FCGI_MAX_REQUESTS=10
exec /usr/local/cpanel/cgi-sys/php5
:: Create custom / individual php.ini
cd /home/username/public_html/cgi-bin/
vi php.ini
example: enable register_globals, so ...
cPanel :: PHP Startup: Suhosin Extension does not officially support PHP 5.2
Posted by blackonsole on September 23rd, 2012 02:49 AM | No Comment
:: error
PHP Warning: PHP Startup: Suhosin Extension does not officially support PHP 5.2 and below anymore, because it is discontinued. Use it at your own risk. in Unknown on line 0
:: How to fix PHP Startup: Suhosin Extension does not ...
PHP :: Fatal error: Class 'DomDocument' not found
Posted by blackonsole on July 17th, 2012 12:44 PM | No Comment
:: PHP error
Fatal error: Class 'DomDocument' not found
:: How to fix
+ install php-xml
yum install php-xml
+ restarting httpd
/etc/init.d/httpd restart
:: Links
+ Google
CentOS:: Install and configure LAMP
Posted by blackonsole on July 16th, 2012 03:09 AM | No Comment
:: How to install LAMP on CentOS
yum install httpd httpd-devel mysql mysql-server mysql-devel php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
:: How to configure MySQL
mysql_secure_installation
:: Add httpd and mysqld on init.d
chkconfig httpd on
chkconfig mysqld on
:: Starting httpd and mysqld
/etc/init.d/httpd start
/etc/init.d/mysqld ...
PHP:: enable pcntl extension from source
Posted by blackonsole on July 6th, 2012 04:06 AM | No Comment
:: Compile pcntl extension
wget //museum.php.net/php5/php-5.3.6.tar.gz
tar xvf php-5.3.6.tar.gz
cd php-5.3.6/ext/pcntl
phpize
./configure
make && make install
:: Configure pcntl extension on php.ini
vi php.ini
; add line like:
extension=pcntl.so
:: Checking pcntl module
php -m | grep pcntl
:: Applying pcntl on httpd
/etc/init.d/httpd restart
:: Links
+ Google
+ StackOverFlow