Say a lot of rookie (such as younger brother I) have encountered the problem of the solution, of course, this solution leads to another problem, solve!

Source: Internet
Author: User
Say a lot of beginners (for example, I) have encountered the solution of the problem, of course, this solution leads to another problem, solve!!
Everyone (super beginner), is not all tried PHP can not parse, that is, the PHP file opened with the browser, the HTML content inside the normal parsing display, but the PHP code can only be shown as the source code, Even if you have passed the ordinary people can not tolerate debugging and Apache overnight configuration, also failed, that is when you are about to give up, I (just a total of 20 hours a day or a failure of the super-white), tell you (just with me to fight the study of the students finally got out), In fact: we need to put our PHP in the default directory Apache (such as my Linux is/var/www/html inside), you can be normal parsing, quickly try it!!


PS: Because I was just know too excited to come up to share, did not go to see the forum there is no same solution, also did not see whether anyone encountered this problem (if no one encountered this mentally retarded problem, I was embarrassed ...). , so I do not know the students to take, know that the Masters do not laugh at me, hehe



In addition, the problem came, as far as I know, as if only I, and my classmates have to "put our PHP in the default directory of Apache" to resolve, the network other people are not needed, so I actually this so-called solution is only another not so serious problem just ~ ~ ~ So in this help everyone, How to do AH ~ ~ I would like to be able to do PHP programming in other parts of the computer ah ...... ~~~~!!!!

------Solution--------------------
Check out the "Configure Apache Virtual host" online.
------Solution--------------------
The impression seems to have a 1/500 chance of appearing what you say.

If the display of the source code, it is almost certainly Apache did not give him to parse the suffix. PHP configuration information
If the download file appears, it is almost certain that PHP does not have a normal installation.

If it appears only in the default directory to see the file, then your Apache configuration should not have the correct settings root directory location ...

It's a lot of stuff. But it's just a matter of fact. If you are just a beginner for PHP for the moment do not tangle here, the next xampp installed to go.
There are a lot of companies you go to when these are already perfected, you just need to understand the directory structure, the FTP will be finished. You can learn it yourself later
and VCs.
------Solution--------------------
Output phpinfo See if your phpinfo is able to parse properly. If you can, then consider whether you have written a short label.
If not, then go back and debug Apache.

Explore

Reference:

The impression seems to have a 1/500 chance of appearing what you say.

If the display of the source code, it is almost certainly Apache did not give him to parse the suffix. PHP configuration information
If the download file appears, it is almost certain that PHP does not have a normal installation.

If it appears only in the default directory to see the file, then your Apache configuration should not have the correct settings root directory location ...

It's a lot of. But it's just a matter of fact. If you're just a beginner for p ...

------Solution--------------------
Must be accessed with "hostname" to be parsed by Apache. localhost represents the local machine.
------Solution--------------------
I also encountered the same situation a few days ago, LZ is a kind of, but if you simply browse the page, you can also change the. php file to. html, can be placed in other locations of the computer normal browsing, will not only show the source code
------Solution--------------------
You're in the wrong place, and your focus should be on how to use PHP instead of configuring the PHP environment, just like you're using a computer, but you don't necessarily need to know how the computer works. Configure the operating environment you just need to know about it, and you don't need to go too deep. In the future to get PHP, directly with the integration of the installation package is OK.
------Solution--------------------
This should be a common sense, not in the parsing directory, of course, will not be resolved, of course, this directory is not necessarily fixed, you can set the
------Solution--------------------
discuss

Reference:

You're in the wrong place, and your focus should be on how to use PHP instead of configuring the PHP environment, just like you're using a computer, but you don't necessarily need to know how the computer works. Configure the operating environment you just need to know about it, and you don't need to go too deep. In the future to get PHP, directly with the integration of the installation package is OK.


I now have this feeling, simply I practice in the localhost, not the pursuit of convenience, anyway, the server after the external is bound to be through the Web server to parse PHP, 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.