Some problems and summary of CentOS

Source: Internet
Author: User
Tags php error

Recently in the knowledge of the review of Linux, there are still a lot of problems will appear to be encountered in the collation of the following:

1, in the installation of the mini version of CentOS through Vitrualbox, in the installation of LNMP environment requires Yum installation wget

An error occurred when entering Yum install wget carriage return at the command line:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6F/0B/wKioL1WQyKmy10q4AAFvIb2ZJ60922.jpg "title=" Qq20150629121708.png "alt=" wkiol1wqykmy10q4aafvib2zj60922.jpg "/> Search and verification by Google and Bing finally found due to DNS misconfiguration, DNS is not configured in the configuration file . the following 2 places need to be modified:

1) Vi/etc/sysconfig/network-scripts/ifcfg-eth0

Modify Onboot=yes Mm_controlled=no these 2 options

Restart Network Service network restart after saving

2) vi/etc/resolve.conf default is empty file need to write content

Add a DNS, nameserver DNS IP address that you can use, and then save the

Finally restart the CentOS system for all normal use


2, set up a good LNMP environment, there has been access denied error, has been ruled out the file permissions of the problem is also excluded is nginx problem, but can not parse PHP problem.

Found that many of the online Daniel is through the Nginx log to troubleshoot errors, but open nginx.conf found that my log information is not detailed enough, so I hope to be able to configure the Log_format

Configuring Nginx's Log_format

① Open nginx.conf

② Delete the original Log_format line, replace it with the following part

Log_format Main ' $remote _addr-$remote _user [$time _local] '

' fwf[$http _x_forwarded_for] tip[$http _true_client_ip] '

' $upstream _addr $upstream _response_time $request _time '

' $geoip _country_code '

' $http _host $request '

"$status" $body _bytes_sent "$http _referer"

' "$http _accept_language" "$http _user_agent" '

③ Save exit

Re-start Nginx

Open the Nginx log file, locate Error.log,tail-f Error.log, and find the following error

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6F/0E/wKioL1WQ-qzRkfljAAps7lJKeUA843.jpg "title=" Qq20150629155048.png "alt=" Wkiol1wq-qzrkfljaaps7ljkeua843.jpg "/>

From the first line can be found to be PHP error, search problems, found that because PHP limited PHP can only run directory, now only in the/tmp/folder run, so in the Nginx Www-root folder under the operation, so there is a denial of access error

Solution:

① Open php.ini File

② Find Open_basedir place.

③ the line, comment out the meaning that PHP can be run in any folder, if you want to be able to run under the specified folder, then set Open_basedir to the appropriate directory

④ Save and exit

Restart PHP-FPM Service PHP-FPM restart

Then visit the webpage and find that the problem is resolved.

This article is from the Web site Architecture Technical Summary blog, please be sure to keep this source http://mengphilip.blog.51cto.com/2243393/1668974

Some problems and summary of CentOS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.