Apache cannot parse PHP program under Linux server

Source: Internet
Author: User
Tags php template script php
Web page Cannot parse PHP, can see the source code

Ideas:

Because Apache can not parse PHP, so we have to see whether PHP loaded parsing php template

1. httpd-m see if there are php5_module

2. If present, add AddType application/x-httpd-php. PHP and Change the default index page of the directory to index.php that is DirectoryIndex index.php

The most important point: Remember to restart Apache, the Linux command: AP achectl Restart restart

Complete ideas:

# Load PHP Module
LoadFile "/opt/php-5.3.1/php5ts.dll"
LoadModule php5_module "/opt/php-5.3.1/php5apache2_2.dll"
# The directory where the php.ini file is located
Phpinidir "/opt/php-5.3.1"
# When a PHP page request is accepted, it is explained to the PHP engine instead of the download page
AddHandler php5-script PHP
AddType application/x-httpd-php. php. php5
AddType Application/x-httpd-php-source. Phps
# Change the directory's default index page to index.php
DirectoryIndex index.php

The above describes the Linux server Apache can not parse the PHP program, including the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.