On the basis of LNMP, how to upload php files into the Linux environment under the Win7 environment

Source: Internet
Author: User
Tags upload php

First, download a WINSCP client

After connecting the host, upload the file to your own save directory

Then go into the database and add our database.

Mysql-uroot-p//This is the command to enter MySQL, but if you do not add Ln-s/usr/local/mysql/bin/mysql/usr/bin, you will enter the following line

/usr/local/mysql/bin/mysql-uroot-p

Create Database db1; DB1 is your database name

Enter after exiting MySQL database

Mysql-uroot-p ' YourPassword ' MySQL </data/db_vote40.sql//After MySQL is the name of the database you entered earlier is DB1, front of MySQL if you did not input ln-s/usr/ Local/mysql/bin/mysql/usr/bin, you need to add/usr/local/mysql/bin/to the front. The following is the location of your database upload.

File, we'll just upload it to the/home/www folder.

But before you need to know one thing, your PHP file to link the database file needs to be modified

Like the files in my linked database

The location of the cursor is our own password under Windows, but the general default is empty.

So the problem is, our database in the Linux environment has a password, so if we want to load PHP under the Linux environment, we need to enter the location of the cursor in our database password

That is, your PHP link file needs to be consistent with the database password.

Then, we need to modify the previous Nginx file configuration

/usr/local/nginx/conf/nginx.  Conf//Enter Nginx file configuration
Modify the server at the end:
 < Span class= "o" > Root/home/www is the location of our PHP files, and sometimes you do not want to be placed under the WWW folder, you can modify it, so as to modify their own storage directory 
Map of the location of the green mark should be noted, if you modify your own storage directory, Then you need to modify the/home/www$fastcgi_script_name code
For example, if your PHP wants to put in/home/www.baidu.com/, then this code will be changed to/HOME/WWW. Baidu.com$fastcgi_script_name
It's worth noting that if you change the default port of 80 as I did, you change it to 81, Then your local login name should be modified by 192.168.128.128 to 192.168.128.128:81


After you modify, you need to test the configuration file for errors: /usr/local/nginx/sbin/nginx-t
Then you need to reload the Nginx , the command is as follows:
Ect/init.d/nginx Reload//reload config Nginx
Ect/init.d/nginx Stop  //Abort Nginx
Ect/init.d/nginx start  //Startup Nginx

On the basis of LNMP, how to upload php files into the Linux environment under the Win7 environment

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.