Under ubuntu source installation PHP7

  - Cited

  Before buying servers expired, and would like to learn a lot but also their own virtual machine installation tired to death, just to see a server to engage in activities to buy a used to play. In fact, you can also use the integrated environment, but sometimes integrated environment unfriendly to expand the installation, the real production is also very seldom have to use an integrated environment

 

  Linux: Ubuntu18 

  PHP: php-7.2.23 

  first official website to download php source, it is best to download the official website, because you download you do not know they have not been processed to source from elsewhere 

  1. Unzip the tar -xvf php-7.2 .23.tar.bz2 

  2. installation ./configure --prefix = / usr / local / php --disable-fileinfo, finally being given configure: error:. libxml2 not found Please check libxml2 installation your missing configuration, what is missing. What installed on it. 
There problem is my server memory is relatively small so to add --disable-fileinfo, otherwise time will make an error, see their own preferences needs more parameters to configure.
  3. Installation given apt-get install libxml2-dev 4. re-execute the second operation, the following occurs can be installed by a detection
  +--------------------------------------------------------------------+
  | License:                                                           |
  | This software is subject to the PHP License, available in this     |
  | distribution in the file LICENSE.  By continuing this installation |
  | process, you are bound by the terms of this license agreement.     |
  | If you do not agree with the terms of this license, you must abort |
  | the installation process at this point.                            |
  +--------------------------------------------------------------------+

  Thank you for using PHP.
  5.make && make install # this process is a bit long, look at the server configuration 
  6. The successful installation can be used to detect whether ./bin/php /usr/local/php/bin/test.php (test file I write a php files used to detect)
  7. configure environment variables I use ubuntu no .bash_profile file, using .profile
  PATH=$PATH:$HOME/bin
  export PHTH
  alias php=/usr/local/php/bin/php

   8 is environmental variables source ~ / .profile, detection php /usr/local/php/bin/test.php, result output.

  ok, the installation is complete.

  

 

  

Guess you like

Origin www.cnblogs.com/caoql/p/11649797.html