Let's talk about a solution to a problem that many Cainiao (such as my younger brother and I) have encountered. of course, this solution leads to another problem!

Source: Internet
Author: User
Let's talk about a solution to a problem that many beginners (such as me) encounter. of course, this solution leads to another problem !! Everybody (Super beginners), have you ever tried php and cannot parse it, that is, php files opened in a browser, and the html content in it can be parsed and displayed normally, however, the php code can only be used as a solution to a problem that many beginners (such as me) encounter. of course, this solution leads to another problem !!
Everybody (Super beginners), have you ever tried php and cannot parse it, that is, php files opened in a browser, and the html content in it can be parsed and displayed normally, however, the php code can only be displayed as source code. even if you have already gone through debugging that is intolerable by ordinary people and apache overnight configuration, it also fails, so when you are about to give up, I (a super white guy who just got a total of 20 hours or failed overnight ), let me tell you (my colleagues who have just worked with me have finally come up with it). in fact: we need to put our php in the default directory of apache (for example, my linux is/var/www/html), and it will be parsed normally. please try it !!


PS: I just learned that I was so excited that I couldn't help but share it. I didn't see the same solution on the forum, no one has encountered this problem (if no one has encountered this mental retardation problem, I am embarrassed ............), So even if you don't know how to use it, do not laugh at me.



In addition, the problem arises. as far as I know, it seems that only me and my colleagues must "put our php in the default directory of apache" to resolve the problem. other people on the Internet do not need it, so in fact, my so-called solution is just another less serious problem ~~~ So what can I do if I ask for help ~~ I want to program php in other places on the computer ........................~~~~!!!!

------ Solution --------------------
Search for "configure apache virtual host" on the Internet.
------ Solution --------------------
There seems to be a 1/500 chance of something you said.

If the source code is displayed, apache does not parse the configuration information of. php.
If a file is downloaded, php is not properly installed.

If the file can only be viewed in the default directory, your apache configuration should not properly set the root directory location...

There are a lot of things, but that's actually something. if you are just a beginner for php, don't worry about it here for the time being, first install xampp.
There are a lot of companies that have been completed when you go. you only need to understand the directory structure and ftp will be finished. you can learn it yourself later.
And vcs.
------ Solution --------------------
Output phpinfo to check whether your phpinfo can be parsed normally. if so, consider whether you have written a short tag.
If not, go back and debug apache.

Discussion

Reference:

There seems to be a 1/500 chance of something you said.

If the source code is displayed, apache does not parse the configuration information of. php.
If a file is downloaded, php is not properly installed.

If the file can only be viewed in the default directory, your apache configuration should not properly set the root directory location...

There are a lot of things, but that's actually something. if you're just a beginner ......

------ Solution --------------------
It must be accessed by the "host name" before it can be parsed by apache. Localhost indicates the local machine.
------ Solution --------------------
Can be placed in other locations on the computer for normal browsing, not only the source code is displayed
------ Solution --------------------
Your focus is on the wrong part. you should focus on how to use PHP, rather than configuring the PHP environment, just like using a computer, but you do not need to know the computer's operating mechanism. To configure the running environment, you only need to know about it and do not need to be too thorough. You can use the integrated installation package to get PHP later.
------ Solution --------------------
This should be a common sense, not in the resolution Directory, of course, will not be parsed, of course, this directory is not necessarily fixed, you can also set
------ Solution --------------------
Discussion

Reference:

Your focus is on the wrong part. you should focus on how to use PHP, rather than configuring the PHP environment, just like using a computer, but you do not need to know the computer's operating mechanism. To configure the running environment, you only need to know about it and do not need to be too thorough. You can use the integrated installation package to get PHP later.


I also feel this way now. I just want to practice it on localhost, so it is not convenient. after the server is loaded, php will be parsed through the web server, should not ......

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.