


Deploy php test environment on ubuntu machine, deploy php_PHP tutorial on ubuntu machine
Deploy php test environment on ubuntu machine, deploy php on ubuntu machine
Deploy php test environment on ubuntu machine
1. Deployment environment
Ubuntu11.10_X86_32, compile and install the corresponding software: nginx+mysql+php.
2. Software installation
2.1 Software Download
libiconv-1.14.tar.gz
libmcrypt-2.5.7.tar.gz
mcrypt-2.6.8.gz
mhash-0.9.9.9.tar.gz
mysql-5.5.39.tar.gz
nginx-1.1.10.tar.gz
pcre-8.20.tar.gz
php-5.4.34.tar.gz
2.2 Environment Configuration
If the system is relatively clean, some necessary software tools need to be installed
apt-get install gcc g++ ssh automake cmake build-essential autoconf make re2c wget cron bzip2 rcconf flex vim bison m4 mawk cpp binutils libncurses5 unzip tar libncurses5 libncurses5-dev libtool libpcre3 libpcrecpp0 libssl-dev zlibc openssl libxml2-dev liblt dl3-dev libpcre3 libpcrecpp0 libssl-dev zlibc openssl libxml2-dev libltdl3-dev libmcrypt-dev
2.3 Auxiliary software installation
2.3.1 libiconv-1.14.tar.gz
tar zxvf libiconv-1.14.tar.gz
cd libiconv-1.14/
cd libiconv-1.14/
./configure --prefix=/usr/local
make
make install
2.3.2 mhash-0.9.9.9.tar.gz
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure
make
make install
cd ../
2.3.3 libmcrypt-2.5.8.tar.gz
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make
make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make
make install
2.3.4 mcrypt-2.6.8.tar.gz
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
/sbin/ldconfig
./configure
make
make install
2.3.5 pcre-8.10.tar.gz
tar zxvf pcre-8.10.tar.gz
cd pcre-8.10
./configure
make
make install
2.4 Install mysql
groupadd mysql #Add mysql group
useradd -g mysql mysql -s /bin/false #Create user mysql and add it to the mysql group. Mysql users are not allowed to log in to the system directly
mkdir -p /data/mysql #Create MySQL database storage directory
chown -R mysql:mysql /data/mysql #Set MySQL database directory permissions
tar zxvf mysql-5.5.19.tar.gz
cd mysql-5.5.19
mkdir -p /usr/local/mysql #Create MySQL installation directory
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8-unicode_ci -DMYSQL_DATADIR=/usr/local/mysql/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DEXTRA_CH ARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DSYSCONFDIR=/etc -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DMYSQL_TCP_PORT=3306
make
make install
cp support-files/my-small.cnf /etc/my.cnf
/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
/usr/local/mysql/scripts/mysql_install_db --user=mysql
cd /usr/local/mysql
cp ./support-files/my-huge.cnf /etc/my.cnf #Copy the configuration file (note: there is a my.cnf under the /etc directory by default, just overwrite it directly)
vi /etc/my.cnf #Edit the configuration file and add
to the [mysqld] sectiondatadir = /data/mysql #Add MySQL database path
./scripts/mysql_install_db --user=mysql #Generate mysql system database
cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld #Add Mysql to the system startup
chmod 755 /etc/init.d/mysqld #Increase execution permissions
Start: bin/mysqld_safe -user=mysql &
ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
ln -s /usr/local/mysql/include/mysql /usr/include/mysql
Change password/usr/local/mysql/bin/mysqladmin -u root -p password "123456"
Error1:
Solution:
2.5 Install php
apt-get install libfreetype6-dev libjpeg8-dev libpng12-dev slapd ldap-utils db5.1-util
apt-get install libldap2-dev libsasl2-dev
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with- mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem - -enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with- xmlrpc --enable-zip --enable-soap --disable-maintainer-zts
Error 1: configure: error: Please reinstall the libcurl distribution - easy.h should be in /include/curl/
Solution: apt-get install curl
apt-get install libcurl4-gnutls-dev
apt-get install php5-curl
Error 2: ldap not found
Solution: Delete ----with-ldap
in the configuration information
make ZEND_EXTRA_LIBS='-liconv'
make test
make install
cp php.ini-production /usr/local/php/etc/php.ini
Execute the command to view PHP related configurations and obtain the extension-dir value of the PHP extension storage directory: /usr/local/php/bin/php-config
The information of extension_dir = is displayed here // http://www.pprar.com
vi /usr/local/php/etc/php.ini
Modify: extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/"
Create fastcgi configuration file
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
Modify fastcgi configuration file
vi /usr/local/php/etc/php-fpm.conf
Uncomment the following lines
pid = run/php-fpm.pid
error_log = log/php-fpm.log
log_level = notice
pm.start_servers
pm.min_spare_servers
pm.max_spare_servers
Modify the following two lines of the file. If you start fastcgi without modification, an error will be reported “fastcgi [pool www] cannot get gid for group ‘nobody’”
user = nobody
group = nobody
was changed to
user = www
group = www
Error 1: “fastcgi [pool www] cannot get gid for group ‘www’”
Solution: You need to create users and groups yourself
Sudo useradd www
Start fastcgi
/usr/local/php/sbin/php-fpm
Error2: ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address already in use (98)
ERROR: FPM initialization failed
Solution: netstat -lntup | grep 9000
Killall php-fpm
Error3: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so : /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: cannot open shared object file: No such file or directory
Solution: 1) Install getlibs
Download: getlibs-all.deb
Execution: sudo dpkg -i --force-all getlibs-all.deb
sudo apt-get update getlibs aapt
2) Install 32-bit library
getlibs -p gnome-keyring:i386
3) Generate symbolic link
sudo ln -s /usr/lib32/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so
2.6 Install Nginx
tar zxvf nginx-1.1.10.tar.gz
cd nginx-1.1.10/
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module
make
make install
Start Nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
Restart the service:/usr/local/nginx/sbin/nginx
Stop service: killall nginx
3. Application deployment
3.1 Environment Deployment
vi /usr/local/nginx/conf/nginx.conf
Add
server {
listen 7070; #External network access port number
server_name blue-desk.com.cn;
location / {
root /usr/local/src/wwwroot; #Application address
index index.html index.htmi index.php;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ .php$ {
root /usr/local/src/wwwroot; #Application address
fastcgi_pass 10.128.7.101:9000; #Port number to contact php-fpm, php-fpm is configured in /usr/local/php/etc/php-fpm.conf
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/src/wwwroot$fastcgi_script_name; #/usr/local/src/wwwroot application location address
include fastcgi_params;
}
}
3.2 Configuration application
onethink application configuration
Database name: mysql
Username: root
Database password: 123456

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











In the Ubuntu system, we often encounter folders with a lock shape on the top. This file often cannot be edited or moved. This is because there is no permission to edit the file, so we need to modify its permissions. How to remove the lock in the lower right corner? Let’s take a look at the detailed tutorial below. 1. Right-click on the locked folder--Properties. 2. Select the permissions option in the window. 3. Select everything inside to create and delete files. 4. Then select Change the permissions of the included files at the bottom, which are also set to create and delete files. Finally, remember to click Change in the upper right corner. 5. If the above lock is still not removed, or the options are grayed out and cannot be operated, you can right-click inside - open the terminal. 6. make

It is a very common problem these days that Ubuntu does not allow its users to open the terminal. If you receive a similar issue and don’t know what to do next, learn about five fixes on how to resolve this “Ubuntu cannot open terminal” issue on your Linux device. Without further ado, let’s dive into what causes it and the solutions available to it. Why can't Ubuntu open the terminal on it? This mainly happens when you install some defective software or modify the terminal configuration. In addition to this, new applications or games that interact with locales and corrupt them can cause similar problems. Some users reported a fix for this issue when searching for Terminal in Ubuntu's activity menu. This shows that

There are many software icons listed in the Ubuntu system start menu. There are many uncommon icons. If you want to delete them, how should you delete them? Let’s take a look at the detailed tutorial below. 1. First enter the ubuntu desktop and click on the start menu under the left panel. 2. You can find a text editor icon inside, we need to delete it. 3. Now we return to the desktop and right-click the mouse to open the terminal. 4. Use the command to open the application list directory. sudonautilus/usr/share/applicationssudonautilus~/.local/share/applications5. Find the corresponding text editor icon inside. 6. Then go straight

In Ubuntu systems, the root user is usually disabled. To activate the root user, you can use the passwd command to set a password and then use the su- command to log in as root. The root user is a user with unrestricted system administrative rights. He has permissions to access and modify files, user management, software installation and removal, and system configuration changes. There are obvious differences between the root user and ordinary users. The root user has the highest authority and broader control rights in the system. The root user can execute important system commands and edit system files, which ordinary users cannot do. In this guide, I'll explore the Ubuntu root user, how to log in as root, and how it differs from a normal user. Notice

Ubuntu24.04LTS, codenamed "NobleNumbat" will be released soon! If you are using a non-LTS version such as Ubuntu 23.10, sooner or later you will need to consider upgrading. For those using Ubuntu20.04LTS or Ubuntu22.04LTS, it is worth thinking about whether to upgrade. Canonical has announced that Ubuntu 24.04LTS will provide update support for up to 12 years, broken down as follows: As an LTS version, it will have 5 years of regular maintenance and security updates. If you subscribe to Ubuntu Pro, you can enjoy an additional 5 years of support. Currently, this additional support period has been extended to 7 years, which means you will get up to 12

OBS is open source software developed by volunteer contributors around the world in their free time. A video live recording software, mainly used for video recording and live streaming. Please note that when installing Ubuntu/Mint, OBSStudio cannot fully work on ChromeOS, and functions such as screen and window capture cannot be used. It is recommended to use xserver-xorg1.18.4 or newer version to avoid potential performance issues with certain features in OBS, such as full-screen projectors. FFmpeg is required. If you don't have FFmpeg installed (if you're not sure, you probably don't), you can get it with: sudoaptinstallffmpeg I already have it installed here

To change the system keyboard layout to American keyboard, how to modify it in Ubuntu system? Let’s take a look at the detailed setting method below. 1. Right-click on the desktop, open openterminal, and enter the command. 2. Just enter the administrator password and select your computer according to the type. 3. Select the country English (us), press tab and select OK. 4. Select English (us) for the keyboard layout to represent the United States. Set a modifier key in Figure 2. 5. Select a key combination to activate its [altgr] function. If you select no, no key combination is needed, and then select yes, then you can set the keyboard layout to English (us), which is an American keyboard.

Starting from Ubuntu 11.04, a new feature has been added called the global menu, which is a common menu bar shared by all applications (shown above). Most of us have been used to each application window having its own menu bar. A global menu is available on the top panel of the Unity desktop, regardless of where the application window is. If the application window in the lower right corner of your screen is resized to small, the application's menu bar remains on the top panel. This can be confusing and uncomfortable if you're not used to it. This experience mainly refers to "This is How Linux Should Be Learned". If you don't like the new global menu and want to move the menu bar back to each application window, we will show you how to disable the global menu. 1. Press Ctrl+Al
