[英]ubuntu server 12.04 - php files downloading
希望有人可以幫助我,我在嘗試下載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腳本卻沒有。
我已經嘗試過此頁面上的所有內容: ubuntu上的apache2-下載php文件,但沒有一個起作用。
當我嘗試運行此命令時:我得到sudo a2enmod php,php模塊不存在。 我想我需要運行命令來安裝它? 如果是這樣,那是什么。
謝謝大家
根據要求提供更多信息:
不確定isp config在哪里存儲每個網站的文件夾,但是我連接到ftp站點並上傳到了web文件夾,就像我為正在工作的drupal和joomla網站所做的一樣
網站啟用:
/
000-apps.vhost@
000-default@
000-ispconfig.conf@
000-ispconfig.vhost@
100-analytics.cyberglide.co.uk.vhost@
100-cyberglide.co.uk.vhost@
100-hideandcollars.co.uk.vhost@
100-jubileeleather.co.uk.vhost@
100-rookselectrical.co.uk.vhost@
100-wolds-uniforms.co.uk.vhost@
所有站點都在工作(它們正在運行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 webmaster@jubileeleather.co.uk
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>
除了在目錄中啟用PHP解析的目錄中擁有自己的PHP文件(由於我一段時間未使用過,不能真正說出Apache是如何完成的)之外,還應該檢查腳本是否具有正確的擴展名(應始終.php)和腳本開始標記<?php
不要使用短標記<?
為避免將腳本移至實時服務器時可能出現的問題。
由於您的文件已退回下載,因此我認為在啟用了PHP分析的目錄中沒有腳本。 發布您的Apache和PHP配置文件可以幫助我們確定問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.