Home > Article > Backend Development > How to install php environment in suse
Suse method to install php environment: 1. Install apache through make install; 2. Install mysql using mysql non-RPM binary installation package; 3. Install php dependent library; 4. Install php; 5. Modify apache configuration file; 6. Start apache.
The operating environment of this article: SUSE Linux Enterprise 15 system, php5.2.6 version, DELL G3 computer.
How does suse install the php environment?
Build an apache php mysql environment on SuSE Linux
1. Install apache
apache installation package: httpd-2.2.9.tar.gz, the installation steps are as follows:
1) ./configure --prefix=/usr/local/httpd-2.2.9
2) make
3) make install
2. Install mysql
Directly use mysql non-RPM binary installation package, such as: mysql-5.1.36-linux -i686-glibc23.tar.gz, the specific steps are as follows:
shell> groupadd mysql shell> useradd -g mysql mysql shell> cd /usr/local shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - shell> ln -s full-path-to-mysql-VERSION-OS mysql shell> cd mysql shell> chown -R mysql . shell> chgrp -R mysql . shell> scripts/mysql_install_db --user=mysql shell> chown -R root . shell> chown -R mysql data shell> bin/mysqld_safe --user=mysql &
3. Install php dependent libraries
libxml2, expat, gd, gettext, use the standard installation of these dependent libraries automake installation method.
4. Install php
php installation package: php-5.2.6.tar.gz, the installation steps are as follows:
1) ./configure --prefix=/ usr/local/php-5.2.6 --enable-mbstring=LANG --with-mysql=/usr/local/mysql --with-gd=/usr/local/gd --with-gettext=/usr/local /gettext --with-libxml-dir=/usr/local/libxml2 --with-libexpat-dir=/usr/local/expat --with-apxs2=/usr/local/httpd/bin/apxs
The parameter --with-apxs2=/usr/local/httpd/bin/apxs is to generate the libphp5.so file, so it is necessary.
2) make
3) make install
After the installation is complete, copy php.ini-dist to /usr/local/php/lib/ and rename it to php .ini. Basically, PHP has been installed successfully here. If an error occurs in the middle, there will generally be no error unless the correct option is selected during configuration.
5. Modify the apache configuration file httpd.conf and add the following two lines:
AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phps
And make sure there is the following sentence in the file. If not, add it after all LoadModules:
LoadModule php5_module modules/libphp5.so
6. Start apache
#/usr/local/httpd/bin/apachectl restart
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to install php environment in suse. For more information, please follow other related articles on the PHP Chinese website!