2012-12-12 54 views
1

希望有人能幫助我,我有同樣的問題,試圖下載的PHP文件。Ubuntu的服務器12.04 - PHP文件下載

我已經嘗試了所有的答案,但:

LN -s /etc/apache2/mods-available/php5.conf /etc/apache2/mods-enabled/php5.conf LN-S的/ etc /的Apache2 /mods-available/php5.load /etc/apache2/mods-enabled/php5.load

當我嘗試它們時,我無法創建符號鏈接文件存在,所以我想這是做完所有準備,任何人都有任何東西更多我可以嘗試,我是新來的Linux和我遵循本指南設置一切:http://www.howtoforge.com/perfect-server-ubuntu-12.04-lts-apache2-bind-dovecot-ispconfig-3

奇怪的事情是joomla和drupal網站的工作,但自己的PHP腳本doesent。

我已經試過這個頁面上的一切: apache2 on ubuntu - php files downloading 但他們都沒有工作。

當我嘗試運行此命令:sudo a2enmod php 我得到,模塊php不存在。我想我需要運行一個命令來安裝它?如果是的話,請問是什麼。

謝謝大家。根據要求

繼承人更多信息:

不知道從哪裏ISP配置存儲每個網站的文件夾,但我連接到FTP站點,並上傳到網絡文件夾,同樣像我一樣對工作的Drupal和Joomla正在工作的

網站的網站啓用:

/ 
[email protected] 
[email protected] 
[email protected] 
[email protected] 
[email protected] 
[email protected] 
[email protected] 
[email protected] 
100-rookselectric[email protected] 
[email protected] 

所有網站都工作(他們正在運行的Joomla或Drupal的),但www.jubileeleather.co.uk/index.php 不得不忍受一個HTML文件直到我能得到它排序。

php腳本:

<?php 
    //Add required class and config files below 
    require ('_class/cms.php'); 
    require ('config/db.php'); 

    //Get Required Page, if its not set call it the index 
    $page = (isset($_GET['page'])) ? $_GET['page'] : 'index'; 

    //If the page is set as index 
    if($page == 'index'){ 
    //Include Index 
    require ('public/index.php'); 
    } 

    //Else if the page is contact 
    elseif ($page == 'contact') { 
    //Include Contact 
    require ('public/contact.php'); 

    //If the page is none of the above 
    } else { 
    //Include Layout 
    require ('public/layout.php'); 
    } 
    ?> 

我正在通過ssh使用膩子,我將如何複製的內容從一個文件張貼在這裏嗎?你還需要哪些文件?再次感謝。

這裏是jubileeleather V主機文件的內容,不知道什麼,我期待在這裏:

的AllowOverride無 訂單拒絕,允許 所有

的DocumentRoot的/ var拒絕/www/jubileeleather.co.uk/web

ServerName jubileeleather.co.uk 
ServerAlias www.jubileeleather.co.uk 
ServerAdmin [email protected] 

ErrorLog /var/log/ispconfig/httpd/jubileeleather.co.uk/error.log 

Alias /error/ "/var/www/jubileeleather.co.uk/web/error/" 
ErrorDocument 400 /error/400.html 
ErrorDocument 401 /error/401.html 
ErrorDocument 403 /error/403.html 
ErrorDocument 404 /error/404.html 
ErrorDocument 405 /error/405.html 
ErrorDocument 500 /error/500.html 
ErrorDocument 502 /error/502.html 
ErrorDocument 503 /error/503.html 

<IfModule mod_ssl.c> 
</IfModule> 

<Directory /var/www/jubileeleather.co.uk/web> 
    Options FollowSymLinks 
    AllowOverride All 
    Order allow,deny 
    Allow from all 
</Directory> 
<Directory /var/www/clients/client3/web4/web> 
    Options FollowSymLinks 
    AllowOverride All 
    Order allow,deny 
    Allow from all 
</Directory> 



# suexec enabled 
<IfModule mod_suexec.c> 
    SuexecUserGroup web4 client3 
</IfModule> 
# Clear PHP settings of this website 
<FilesMatch "\.ph(p3?|tml)$"> 
    SetHandler None 
</FilesMatch> 
# php as fast-cgi enabled 
# For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html 
<IfModule mod_fcgid.c> 
    IdleTimeout 300 
    ProcessLifeTime 3600 
    # MaxProcessCount 1000 
    DefaultMinClassProcessCount 0 
    DefaultMaxClassProcessCount 100 
    IPCConnectTimeout 3 
    IPCCommTimeout 360 
    BusyTimeout 300 
</IfModule> 
<Directory /var/www/jubileeleather.co.uk/web> 
    AddHandler fcgid-script .php .php3 .php4 .php5 
    FCGIWrapper /var/www/php-fcgi-scripts/web4/.php-fcgi-starter .php 
    Options +ExecCGI 
    AllowOverride All 
    Order allow,deny 
    Allow from all 
</Directory> 
<Directory /var/www/clients/client3/web4/web> 
    AddHandler fcgid-script .php .php3 .php4 .php5 
    FCGIWrapper /var/www/php-fcgi-scripts/web4/.php-fcgi-starter .php 
    Options +ExecCGI 
    AllowOverride All 
    Order allow,deny 
    Allow from all 
</Directory> 


# add support for apache mpm_itk 
<IfModule mpm_itk_module> 
    AssignUserId web4 client3 
</IfModule> 

<IfModule mod_dav_fs.c> 
    # Do not execute PHP files in webdav directory 
    <Directory /var/www/clients/client3/web4/webdav> 
    <FilesMatch "\.ph(p3?|tml)$"> 
     SetHandler None 
    </FilesMatch> 
    </Directory> 
    DavLockDB /var/www/clients/client3/web4/tmp/DavLock 
    # DO NOT REMOVE THE COMMENTS! 
    # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE! 
    # WEBDAV BEGIN 
    # WEBDAV END 
</IfModule> 

+0

你把你的php腳本放在哪裏?/etc/apache2/sites-enabled的內容是什麼?您應該在那裏看到一個名爲000-default的文件。是文件的內容? – steven

+0

謝謝,更新了帖子。 –

+0

你有根服務器嗎?它看起來像你的域沒有啓用PHP或.php擴展名不關聯用php解析。如果joomla和drupal工作,所以php正在服務器上運行。看看100-jubileeleather.co.uk.vhost @看看裏面配置了什麼。 – steven

回答

0

除了在啓用了PHP解析功能的目錄中擁有自己的PHP文件(無法真正說出它如何使用Apache,因爲我沒有使用一段時間),您應該檢查腳本是否具有正確的擴展名(應始終爲.php)和腳本開始標記<?php - 請勿使用短標記<?以避免將腳本移至活動服務器時可能出現的問題。

由於您的文件被返回下載,我認爲您沒有在啓用PHP解析的目錄中有您的腳本。發佈您的Apache和PHP配置文件可以幫助我們識別問題。

相關問題