Home php教程 php手册 Mint+Nginx+Mysql+php

Mint+Nginx+Mysql+php

Jun 06, 2016 pm 07:45 PM
Overview

未成稿 概述 这篇文章记录一个我们在自己电脑上折腾linux中基本上必做的一个任务:php本地测试环境的搭建。众所周知,传统的配置选用LAMP(linux ApacheMysqlphp),这里我所配置有两点不同: 1、只是把web sever 从Apache换成了Ngnix, 2、还有一点点不同就

未成稿

概述

     这篇文章记录一个我们在自己电脑上折腾linux中基本上必做的一个任务:php本地测试环境的搭建。众所周知,传统的配置选用LAMP(linux +Apache+Mysql+php),这里我所配置有两点不同:

1、只是把web sever 从Apache换成了Ngnix,

2、还有一点点不同就是linux系统我没有用国内在PC上呼声最高的ubuntu,而是选用了它的衍生版本mint。

为什么这么换呢,下面说一下理由:

Ngnix

       我目前对这个web sever了解很少很少,不过在光各大网站的网页时(如淘宝,新浪云平台),从F12(web控制台)里看到很多大网站都开始用这个开源软件做服务器程序,所以准备在自己电脑上研究研究,所以这次就抛弃了Apache,投入了新人的怀抱!下面是图证:

图1

Mint+Nginx+Mysql+php

       这是淘宝首页的http首部信息,可以在Response Headers中清楚的看到Sever用的是Tengine(图中最后一行),你肯定会想这个Tengine和我们这里的Nginx又毛关系,好吧,我们上连接:http://tengine.taobao.org/

Mint+Nginx+Mysql+php     

这回就明了了淘宝的Tengine与Nginx的血缘关系。

图2

Mint+Nginx+Mysql+php

        图2是新浪云平台的首页,这里就直接用的nginx了。

        看网上很多人都评价这是一个高性能的服务器程序,比Apache性能要高,但至于原理,我还不了解,博主就是抱着学习的心态才装的这个服务器!看到应用如此广泛,我想不了解的人都会心痒痒的。

小马我再centos和ubuntu之间徘徊的一圈,最后还是回归到了mint。其实mint这个版本和ubuntu基本没太大区别(mint这个版本是建立在ubuntu上的),但mint较之ubuntu所吸引我的是它简介的界面,

mysql:

cmake 提示错误:缺少软件包

CMake Error at cmake/readline.cmake:85 (MESSAGE):
  Curses library not found.  Please install appropriate package,

      remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
  cmake/readline.cmake:128 (FIND_CURSES)
  cmake/readline.cmake:202 (MYSQL_USE_BUNDLED_EDITLINE)
  CMakeLists.txt:410 (MYSQL_CHECK_EDITLINE)
Copy after login

安装

sudo apt-get install libncurses5-dev
Copy after login

安装完之后要把CMakeCache.txt文件删除,再重新进行 sudo cmake ./


发现又报了个警告

Warning: Bison executable not found in PATH
Copy after login

继续安装Bison

重复上面工作


缺少一个叫做PCRE的库,下载地址:http://www.pcre.org/

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.</path>
Copy after login

又少了个缺少一个叫做zlib的库, 下载地址:http://www.zlib.net/


之后全了!


启动命令:sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf (记得加sudo!!!!)

之后终于看到了页面!

Mint+Nginx+Mysql+php

PHP安装

./configure错误:

configure: error: xml2-config not found. Please check your libxml2 installation.
Copy after login
提示木有libxml2,查了一下,其实是没有libxml2-dev,所以执行命令安装:
sudo apt-get install libxml2-dev
Copy after login


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Overview of operator overloading problems and solutions in C++ Overview of operator overloading problems and solutions in C++ Oct 08, 2023 pm 01:02 PM

Overview of Operator Overloading Problems and Solutions in C++ Introduction: Operator overloading is an important feature of the C++ language, which allows programmers to customize existing operators to operate custom data types. However, operator overloading needs to be used with caution, because if used improperly or excessively, it will lead to problems such as reduced code readability, ambiguity, and reduced efficiency. This article will outline common problems with operator overloading in C++ and provide corresponding solutions and code examples. 1. Problems with operator overloading 1.1 Ambiguity problem in operator overloading

Python Tkinter shows off its power: Create stunning GUI applications Python Tkinter shows off its power: Create stunning GUI applications Mar 24, 2024 am 09:11 AM

Tkinter is a powerful GUI library in python that can be used to create cross-platform desktop applications. With its ease of use and wide range of features, it provides various tools for building user interfaces, handling events and managing layouts. Creating a GUI Window To create a GUI window, you need to use the Tkinter.Tk() method. This method returns a Tk() object that represents the application's main window. A window can have a title using the title() method, and the window size and position using the geometry() method. importtkinterastkroot=tk.Tk()root.title(&quot;My first Tkinter application&quot;)root.g

PHP High Availability: Best Practices for 24/7 Application Availability PHP High Availability: Best Practices for 24/7 Application Availability Mar 26, 2024 pm 09:31 PM

Achieving high availability of applications is critical to ensure seamless operation of critical business services. For applications built with PHP, there are several best practices that can be used to achieve 24/7 availability. Failover and fault-tolerant load balancing: Use a backend load balancer to distribute traffic to multiple servers to avoid single points of failure. Failover: Configure an automatic failover mechanism to transfer traffic to an alternate server in the event of a failure. Fault-tolerant encoding: Use fault-tolerant encoding techniques, such as RaiD or erasure codes, to protect data from disk failures. Redundant and elastic auto-scaling: Enable auto-scaling to dynamically add or remove servers based on load. Multi-AZ deployment: Deploy applications to multiple Availability Zones (AZ) to maximize

Overview of EventLoop library in PHP8.0 Overview of EventLoop library in PHP8.0 May 14, 2023 am 08:49 AM

With the development of the PHP language, developers need more tools to solve the needs and challenges of modern applications, one of which is event-driven programming, and the EventLoop library of PHP8.0 was born for this purpose. This article will provide an overview and introduction to the library. What is EventLoop In traditional PHP applications, most operations are synchronous. In other words, the program will execute some code, then wait for the relevant data to return, and then continue to execute subsequent code. This programming model is useful for some applications

Introducing Wireless Networks Introducing Wireless Networks Feb 19, 2024 pm 10:38 PM

Overview of Wireless Networks With the rapid development of technology, wireless networks have become an indispensable part of modern life. Our mobile phones, computers, smart homes and other devices all rely on wireless networks for communication and connection. In this article, we will provide an overview of wireless networks and discuss its development, principles, and applications. The development of wireless networks can be traced back to radio communication technology in the 19th century. At that time, people used radio waves to realize long-distance sound and image transmission, pioneering wireless communication. With the further development of electronic technology

Revealing the behind-the-scenes story of the Yii framework: Controlling a new realm of PHP development Revealing the behind-the-scenes story of the Yii framework: Controlling a new realm of PHP development Mar 26, 2024 am 10:31 AM

The Yii framework is a modern, high-performance PHP framework designed to simplify and accelerate WEB application development. It provides a robust foundation that enables developers to focus on business logic rather than low-level details. Behind the Scenes Modular Architecture: Yii adopts a modular architecture so that applications can be easily extended and customized. A module is an independent, reusable block of code that can be used to implement a specific functionality, such as user management or e-commerce. MVC Pattern: Yii follows the mvc (Model-View-Controller) pattern, which separates the application logic from the presentation layer. This promotes code maintainability and improves application testability. ORM support: Yii provides a powerful object-relational mapping (ORM) layer that enables developers to

PHP namespace overview PHP namespace overview Aug 20, 2023 am 11:29 AM

IntroductionInPHP,useofnamespacesallowsclasses/functions/constantsofsamenamebeusedindifferentcontextswithoutanyconflict,therebyencapsulatingtheseitems.Anamespaceislogicalgroupingofclasses/functionsetcdependingontheirrelevence.Justasafilewithsamenamec

Remove project management barriers with PHP Git Remove project management barriers with PHP Git Mar 31, 2024 pm 12:11 PM

When managing large, complex software projects, project management tools are essential to simplify collaboration, stay organized, and increase efficiency. PHPgit, as a distributed version control system, can effectively eliminate obstacles in project management through its powerful functions and flexible features. Eliminate communication barriers Git's collaborative features simplify communication between team members. By using branches and merge requests, teams can work on different versions of files simultaneously and clearly track changes and conflicts. The code review and feedback process becomes more transparent and efficient, reducing misunderstandings and miscommunication. Enhanced organization Git's history feature provides a complete record of changes to your project. Team members can easily view the change history of files and branches to see who made specific changes

See all articles