browser downloads php file from apache web server

后端 未结 3 620
隐瞒了意图╮
隐瞒了意图╮ 2021-01-17 23:43

I have an apache web server. Let\'s say this server\'s domain is example.com.

When I access example.com, then the index.php file is co

3条回答
  •  迷失自我
    2021-01-18 00:35

    If you are on Debian/Ubuntu take a look at this file /etc/apache2/mods-available/php5.conf

    mine looks like this and you can see I had to comment some line to get PHP working in the user dir

    
        
            SetHandler application/x-httpd-php
        
        
            SetHandler application/x-httpd-php
        
        
            SetHandler application/x-httpd-php-source
        
        # To re-enable php in user directories comment the following lines
        # (from  to .) Do NOT set it to On as it
        # prevents .htaccess files from disabling it.
        #
        #    
        #        php_admin_value engine Off
        #    
        #
    
    

    Please note that after editing the file you would have to restart apache for the modifications to take effect, the command to restart apache on a debian based system is: /etc/init.d/apache2 restart

提交回复
热议问题