Manual installation of LiteSpeed+PHP+MySQL tutorial in Debian

Debian system has always been Micro magic With the favorite Linux branch, the minimized system occupies very little system resources and is easy to operate. Recently, I posted some tips on manual installation of LiteSpeed after several troubles. If you are too lazy to use your head, you can refer to it Previous articles , use llsmp to install the package. Now start the installation!

  1. Clean Debian and remove unnecessary software packages
  2. Install MySQL and related library files
  3. Installing LiteSpeed
  4. Compiling PHP
  5. Configure eAccelerator
  6. Installing Zend Loader

1. Clean Debian and remove unnecessary software packages

 apt-get update apt-get -y purge apache2-* bind9-* xinetd samba-* nscd-* portmap sendmail-* sasl2-bin apt-get -y purge lynx memtester unixodbc python-* odbcinst-* sudo tcpdump ttf-* apt-get autoremove && apt-get clean

2. Install MySQL and related library files

 apt-get remove apache apt-get update apt-get upgrade apt-get install autoconf gcc g++ libjpeg62-dev libpng12-dev libxml2-dev curl libcurl4-openssl-dev libmcrypt-dev libmhash-dev libfreetype6-dev patch make mcrypt mysql-server libmysql++-dev zlib-bin zlib1g-dev

Set autoconf

 export PHP_ AUTOCONF=/usr/bin/autoconf export PHP_ AUTOHEADER=/usr/bin/autoheader

During installation, you will be asked for the MySQL password. You can enter it twice in succession

3. Install LiteSpeed

Visit LiteSpeed official website to get the download link of the latest version:

 cd /tmp wget tar zxvf lsws* cd lsws* sh ./

The license agreement appears, just press the [Space] key to the end and enter Yes (note that Y is capitalized)

Answer the following questions interactively

Destination [/usr/local/lsws]: Enter
User name [admin]: administrator account (default admin)
Password: administrator password
Retype password: Password confirmation
Email addresses [ root@localhost ]: Your email
User [nobody]: default, enter directly
Group [nogroup]: default, enter directly
HTTP port [8088]: write 80
Admin HTTP port [7080]: Litespeed panel port, which can be defaulted and entered directly
Setup up PHP [Y/n]: default, enter directly
Suffix for PHP script (comma separated list) [php]: default, enter directly
Would you like to install AWStats Add-on module [y/N]? Default, enter directly
Would you like to have LiteSpeed Web Server started automatically when the server restarts [Y/n]? Default, enter directly
Would you like to start it right now [Y/n]? Default, enter directly

Do not close the SSH window at this time. It will be used later~

4. Compile PHP

To access the lite speed management background: http://ip:7080

Click Actions ->Compile PHP

Select the PHP version and click Next (I selected 5.3.15)

Fill in the compilation parameters as follows:,

 '--with-pdo-mysql' '--with-mysql' '--with-mysqli' '--with-zlib' '--with-gd' '--enable-shmop' '--enable-track-vars' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes' '--enable-mbstring' '--with-iconv' '--with-litespeed' '--enable-inline-optimization' '--with-curl' '--with-curlwrappers' '--with-mcrypt' '--with-mhash' ' --with-mime-magic' '--with-openssl' '--with-freetype-dir=/usr/lib' '--with-jpeg-dir=/usr/lib'

When compiling a small memory VPS, there will be a problem of insufficient memory "virtual memory exhausted: Cannot allocate memory". At this time, add the following parameters to the parameter bar and recompile it~


The following optional installation components, I only select eAccelerator;

Click Build PHP 5. x.x

LiteSpeed starts to download the package. After downloading, click Next

Do not refresh the page at this time!

Run the following command on SSH:

 /usr/local/lsws/phpbuild/buildphp_ manual_

Until the browser prompts "* Complete *", it is considered to be completed~

5. Configure eAccelerator

Although PHP has been installed, the eAccelerator we selected needs to be configured

Create the cache directory of eAccelerator

 mkdir /usr/local/eaccelerator_ cache chmod -R 777 /usr/local/eaccelerator_ cache

Edit php.ini

 cp /usr/local/lsws/php/php.ini /usr/local/lsws/lsphp5/lib/ vi /usr/local/lsws/lsphp5/lib/php.ini

Add the following fields after php. ini

 [eaccelerator] zend_ extension="/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/" eaccelerator.shm_ size="1" eaccelerator.cache_ dir="/usr/local/eaccelerator_cache" eaccelerator.enable="1" eaccelerator.optimizer="1" eaccelerator.check_ mtime="1" eaccelerator.debug="0" eaccelerator.filter="" eaccelerator.shm_ max="0" eaccelerator.shm_ ttl="3600" eaccelerator.shm_ prune_ period="3600" eaccelerator.shm_ only="0" eaccelerator.compress="1" eaccelerator.compress_ level="9" eaccelerator.keys = "disk_only" eaccelerator.sessions = "disk_only" eaccelerator.content = "disk_only"

At this time, you can open http://ip/phpinfo.php See how eAccelerator is installed~

6. Install Zend Loader

 wget tar zxvf ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz mkdir -p /usr/local/zend/ cp ZendGuardLoader-php-5.3-linux-glibc23-i386/php-5.3.x/ /usr/local/zend/

Edit php.ini

 vi /usr/local/lsws/lsphp5/lib/php.ini

Add the following fields

 [Zend.loader] zend_ loader.enable=1 zend_ loader.disable_ licensing=1 zend_ loader.obfuscation_ level_ support=3 zend_ loader.license_ path= zend_ extension="/usr/local/zend/"

Check whether the installation is successful

 /usr/local/lsws/lsphp5/bin/php -v

Finally, restart lite speed to take effect~

 /etc/init.d/lsws restart

The environment is basically configured, but a series of steps and processes such as adding a virtual host are needed to use it. WeChat Magic will share them with you in future tutorials~

The writing of this article draws on many excellent online articles, thanks to Baidu, thanks to Google, and thanks by name Xiaoye w0w and Host code , and some unknown geeks who may even be the original authors of these resources~

Guess you like

About the author: Micro magic

Small demons, great wisdom!

Multiple comments

        1. apt-get install autoconf gcc g++ libjpeg62-dev libpng12-dev libxml2-dev curl libcurl4-openssl-dev libmcrypt-dev libmhash-dev libfreetype6-dev patch make mcrypt mysql-server libmysql++-dev zlib-bin zlib1g-dev
          After installing MySQL, you will be prompted to enter a password. The interface is in SSH window mode, which should be obvious, unless your Debian has MySQL installed by default... If so, the default user name is root and the password is empty. You can enter mysql directly under ssh to see if you can enter ->mysql mode~remember to change the password of mysql after installation.

          1. After this operation, 226MB of additional disk space will be used.
            Do you want to continue [Y/n]?

            Install these packages without verification [y/N]?

            I seem to see the two hints of losing

  1. Appears when installing Litespeed
    /usr/local/lsws/bin/lswsctrl: 236: ./ litespeed: not found
    [ERROR] Failed to start litespeed!
    [ERROR] Failed to start the web server. For trouble shooting information,
    please refer to documents in “/usr/local/lsws/docs/”.

    1. I didn't encounter this problem. I didn't find the errors you provided on the Internet... Make sure the previous commands don't make mistakes. The system is Debian, etc. If there are still errors, there is no way

    2. I found the reason. It has something to do with the system. Litespeed uses a 32-bit host. A 64 bit host can be fixed by installing a 32-bit compatible library. The command is apt get install ia32 libs

      1. Litespeed has a special 64 bit version. You can install that version on a 64 bit system. It should not be necessary to install the ia32 libs package. This article demonstrates the 32-bit version

          1. Well, the 64 bit version seems to be old, and the official page reads "If you want to run the standard version on 64bit Linux, you need to install 32bit compatible libraries (ia32 libs for Ubuntu/Debian and glibc for CentOS)."

        1. Well, yes, one compatible package can do it anyway. However, LiteSpeed doesn't have enough Chinese information. I used to use a space provider based on Litespeed, so I am very fond of this. Now I have deployed my own VPS, and it's good to use fewer small stations

  2. When compiling PHP,/bin/sh/usr/local/lsws/phpbuild/php-5.3.15/libtool – silent – preserve dup deps – mode=compile gcc - I/usr/local/lsws/phpbuild/php-5.3.15/ext/fileinfo/libmagic - Text/fileinfo/- I/usr/local/lsws/phpbuild/php-5.3.15/ext/fileinfo/- DPP_ ATOM_ INC -I/usr/local/lsws/phpbuild/php-5.3.15/include -I/usr/local/lsws/phpbuild/php-5.3.15/main -I/usr/local/lsws/phpbuild/php-5.3.15 -I/usr/local/lsws/phpbuild/php-5.3.15/ext/date/lib -I/usr/local/lsws/phpbuild/php-5.3.15/ext/ereg/regex -I/usr/include/libxml2 -I/usr/local/lsws/phpbuild/php-5.3.15/ext/mbstring/oniguruma -I/usr/local/lsws/phpbuild/php -5.3.15/ext/mbstring/libmbfl -I/usr/local/lsws/phpbuild/php-5.3.15/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/usr/local/lsws/phpbuild/php-5.3.15/ext/sqlite3/libsqlite -I/usr/local/lsws/phpbuild/php-5.3.15/TSRM -I/usr/local/lsws/phpbuild/php-5.3.15/Zend -I/usr/include -g -O2 -fvisibility=hidden -c /usr/local/lsws/phpbuild/php-5.3.15/ext/ fileinfo/libmagic/apprentice.c -o ext/fileinfo/libmagic/apprentice.lo
    gcc: Internal error: Killed (program cc1)
    Please submit a full bug report.
    See for instructions.
    make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1
    **ERROR** Could not compile PHP

    1. What is the VPS memory? OVZ is still Xen. It seems that this error is also caused by insufficient memory when gcc compiles PHP. It is mentioned in the article that you can add a parameter of – disable fileinfo to recompile~

      1. The added code has been compiled. Thank you. But there seems to be a problem with your display. The code should be two linked. Now it shows a-

    1. If you are talking about PHPMyadmin, it is not installed in this article. If it is a simple database command, I will install it directly under the MySQL command line. If you want to know more, you can search this website. Of course, installing PHPMyadmin itself is not difficult. Search the Internet for tutorials~~

  3. Advice: PHP should have succeeded in the installation process, but another error was reported
    Ask VM for help:
    Changing to build directory /usr/local/lsws/phpbuild/php-5.4.13/eaccelerator-
    Running PHPize for eAccelerator extension
    Configuring for:
    PHP Api Version: 20100412
    Zend Module Api No: 20100525
    Zend Extension Api No: 220100525
    Configuring eAccelerator extension build
    /usr/local/lsws/phpbuild/buildphp_ line 165: ./ configure: No such file or directory
    **ERROR** Could not configure eAccelerator extension build

Post reply

Your email address will not be disclosed. Required items have been used * tagging