douyanning3724 2013-03-06 06:28
浏览 59

无法访问apache上的php文件

I installed Apache, Php, Mysql on Ubuntu 10.04 x32. After I install them I can't access some php files. APM is ON. Followings are some files and .htaccess to figure the problem out. If you can't see the "can access" files on browser, server might be down.

permissions: phpinfo.php 644, index.php 600 , hello.php 600

[can access]

http://222.118.53.30/phpinfo.php
http://222.118.53.30/phpmyadmin

[can't access]

http://222.118.53.30/index.php
http://222.118.53.30/hello.php

.haccess is following

SetEnv APPLICATION_ENV development



Options -Indexes

Options +FollowSymLinks

DirectoryIndex index.php index.html

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)\?*$ index.php [L,QSA]

#remove www.

#RewriteCond %{HTTPS} off

#RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]

#RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

#RewriteRule ^(.*\.(png|jpg|jpeg|gif))$ index.php?controller=minify&action=index&file_path=$1&ext=$2 [L,NC]

#RewriteRule ^(.*\.(css|js))$ index.php?controller=minify&action=jscss&file_path=$1&ext=$2 [L,NC]


</IfModule>

ErrorDocument 404 index.php

<ifModule mod_expires.c>

ExpiresActive On

ExpiresDefault "access plus 1 seconds"

ExpiresByType text/html "access plus 1 seconds"

ExpiresByType image/gif "access plus 2592000 seconds"

ExpiresByType image/jpeg "access plus 2592000 seconds"

ExpiresByType image/png "access plus 2592000 seconds"

ExpiresByType text/css "access plus 604800 seconds"

ExpiresByType text/javascript "access plus 216000 seconds"

ExpiresByType application/x-javascript "access plus 216000 seconds"

</ifModule>

<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak|cache)$">

Order Allow,Deny

Deny from all

</FilesMatch>

[hello.php]

<?php 
 echo "Hello World";
?>

[index.php]

<?php 

// Define application path
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/application/'));

// Define base path
defined('BASE_PATH')
|| define('BASE_PATH', realpath(dirname(__FILE__)));

// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../JO/v.0.9b/'),
realpath(APPLICATION_PATH . '/library/'),
get_include_path(),
)));

require_once 'JO/Application.php';

// Create application, bootstrap, and run
$application = new JO_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/config/application.ini',
isset($argv) ? $argv : null
); 

// Set Routers links
$configs_files = glob(APPLICATION_PATH . '/config/config_*.ini');
if($configs_files) {
foreach($configs_files AS $file) {
    $config = new JO_Config_Ini($file);
    $application->setOptions($config->toArray());
    JO_Registry::set(basename($file, '.ini'), $config->toArray());
}
}

// Set Routers links
$routers_files = glob(APPLICATION_PATH . '/config/routers/*.ini');
if($routers_files) {
foreach($routers_files AS $file) {
    $config = new JO_Config_Ini($file, null, false, true);
    $application->setOptions($config->toArray());
    JO_Registry::set('routers_'.basename($file, '.ini'), $config->toArray());
}
}

//dispatch application
$application->dispatch();



// error handler function
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
if (!(error_reporting() & $errno)) {
    // This error code is not included in error_reporting
    return;
}

switch ($errno) {
case E_USER_ERROR:
    echo "<b>My ERROR</b> [$errno] $errstr<br />
";
    echo "  Fatal error on line $errline in file $errfile";
    echo ", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />
";
    echo "Aborting...<br />
";
    exit(1);
    break;

case E_USER_WARNING:
    echo "<b>My WARNING</b> [$errno] $errstr<br />
";
    break;

case E_USER_NOTICE:
    echo "<b>My NOTICE</b> [$errno] $errstr<br />
";
    break;

default:
    echo "Unknown error type: [$errno] $errstr<br />
";
    break;
}

/* Don't execute PHP internal error handler */
return true;
}

Could you please help me out what is wrong with my configuration ?

  • 写回答

3条回答 默认 最新

  • douxiong0668 2013-03-06 06:33
    关注

    Those files are showing HTTP 500 Internal server error. That means those files have some code which is not working for your version of PHP. You need to look at the codes in those files

    评论

报告相同问题?

悬赏问题

  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)