PHP Warning: require(): open_basedir restriction in effect
- wsshark
- Člen | 6
Zdravím,
máme web http://petrova-pojistka.cz/ a ten bezproblémově funguje na
localhostu i na serveru programátora jen na wedos VPS centos 6.0 s ISP
configem 3 nejede kvůli nastavení base dir
produkčním modu to jde naprosto normálně ale v development modu to nejde vůbec
nastavit base dir na / jsem už zkoušel a přidat do něj snad všechny složky také což je vidět níže
Nette Framework (version 2.0.3 released on 2012–04–04, https://nette.org)
PHP 5.3
ISP config 3
CentOs 6.0
do logo se ukládají tyto chyby
[Thu May 17 01:12:38 2012] [warn] [client 89.103.84.37] mod_fcgid: stderr: PHP
Warning: require(): open_basedir restriction in effect. File() is not within the
allowed path(s): (
/var/www/clients/client0/web36/app/:
/var/www/clients/client0/web36/libs/:
/var/www/clients/client0/web36/web/:
/var/www/clients/client0/web36:
/var/www/clients/client0/web36/tmp:
/var/www/petrova-pojistka.cz/web:
/var/www/petrova-pojistka.cz:
/srv/www/petrova-pojistka.cz:
/srv/www/petrova-pojistka.cz/web:
/usr/share/php5:
/tmp:
/usr/share/phpmyadmin:
/etc/phpmyadmin:
/var/lib/phpmyadmin
) in /var/www/clients/client7/web36/web/index.php on line 15
[Thu May 17 01:12:38 2012] [warn] [client 89.103.84.37] mod_fcgid: stderr:
PHP Warning: require(): open_basedir restriction in effect. File() is not within
the allowed path(s): (
/var/www/clients/client0/web36/app/:
var/www/clients/client0/web36/libs/:
/var/www/clients/client0/web36/web/:
/var/www/clients/client0/web36:
/var/www/clients/client0/web36/tmp:
/var/www/petrova-pojistka.cz/web:
/var/www/petrova-pojistka.cz:
/srv/www/petrova-pojistka.cz:
/srv/www/petrova-pojistka.cz/web:
/usr/share/php5:
/tmp:
/usr/share/phpmyadmin:
/etc/phpmyadmin:
/var/lib/phpmyadmin
) in /var/www/clients/client7/web36/app/bootstrap.php on line 29
budu rád za každou radu
- wsshark
- Člen | 6
nastavil jsem to tam a pořád to v developmentu nejde
[Fri May 18 16:47:36 2012] [warn] [client 89.103.84.37] mod_fcgid: stderr: PHP Warning: require(): open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/clients/client7/web36/app/:/var/www/clients/client7/web36/libs/:/var/www/clients/client7/web36/web/:/var/www/clients/client7/web36:/var/www/clients/client7/web36/tmp:/var/www/petrova-pojistka.cz/web:/var/www/petrova-pojistka.cz:/srv/www/petrova-pojistka.cz:/srv/www/petrova-pojistka.cz/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client7/web36/web/index.php on line 15
[Fri May 18 16:47:36 2012] [warn] [client 89.103.84.37] mod_fcgid: stderr:
PHP Warning: require(): open_basedir restriction in effect. File() is not within
the allowed path(s):
(/var/www/clients/client7/web36/app/:/var/www/clients/client7/web36/libs/:/var/www/clients/client7/web36/web/:/var/www/clients/client7/web36:/var/www/clients/client7/web36/tmp:/var/www/petrova-pojistka.cz/web:/var/www/petrova-pojistka.cz:/srv/www/petrova-pojistka.cz:/srv/www/petrova-pojistka.cz/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin)
in /var/www/clients/client7/web36/app/bootstrap.php on line 29
[Fri May 18 16:47:36 2012] [warn] [client 89.103.84.37] mod_fcgid: stderr: PHP
Fatal error: Uncaught exception ‚Nette\\DirectoryNotFoundException‘ with
message ‚Directory 'development‘ is not found.' in
/var/www/clients/client7/web36/libs/Nette/Diagnostics/Debugger.php:244
[Fri May 18 16:47:36 2012] [warn] [client 89.103.84.37] mod_fcgid: stderr: Stack trace:
[Fri May 18 16:47:36 2012] [warn] [client 89.103.84.37] mod_fcgid: stderr: #0 /var/www/clients/client7/web36/libs/Nette/Config/Configurator.php(135): Nette\\Diagnostics\\Debugger::enable(false, ‚development‘, ‚/var/www/client…‘)
[Fri May 18 16:47:36 2012] [warn] [client 89.103.84.37] mod_fcgid: stderr: #1 /var/www/clients/client7/web36/app/bootstrap.php(57): Nette\\Config\\Configurator->enableDebugger(‚development‘, ‚/var/www/client…‘)
[Fri May 18 16:47:36 2012] [warn] [client 89.103.84.37] mod_fcgid: stderr: #2 /var/www/clients/client7/web36/web/index.php(15): require(‚/var/www/client…‘)
[Fri May 18 16:47:36 2012] [warn] [client 89.103.84.37] mod_fcgid: stderr: #3 {main}
[Fri May 18 16:47:36 2012] [warn] [client 89.103.84.37] mod_fcgid: stderr: thrown in /var/www/clients/client7/web36/libs/Nette/Diagnostics/Debugger.php on line 244
- wsshark
- Člen | 6
index ve složce /web
<?php
// absolute filesystem path to this web root
define('WWW_DIR', __DIR__);
// absolute filesystem path to the application root
define('APP_DIR', WWW_DIR . '/../app');
// absolute filesystem path to the libraries
define('LIBS_DIR', WWW_DIR . '/../libs');
// uncomment this line if you must temporarily take down your site for maintenance
// require APP_DIR . '/templates/maintenance.phtml';
// load bootstrap file
require APP_DIR . '/bootstrap.php';
?>
celý bootstrap.php ve složce /app
<?php
/**
* My Application bootstrap file.
*/
//error_reporting(E_ALL);
use Nette\Environment,
Nette\Diagnostics\Debugger,
Nette\Application\Routers\Route,
Nette\Application\Routers\RouteList as MultiRouter;
// Load Nette Framework
require LIBS_DIR . '/Nette/loader.php';
const PAYMENT_STATUS_ALL = 'all';
const PAYMENT_STATUS_PAY = 'pay';
const PAYMENT_STATUS_NOPAY = 'nopay';
// Configure application
$configurator = new Nette\Config\Configurator;
//Debugger::enable($configurator::DEVELOPMENT);
// Enable Nette Debugger for error visualisation & logging
$configurator->setProductionMode(true);
//$configurator->enableDebugger($configurator::DEVELOPMENT, __DIR__ . '/../logger'); //
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()
->addDirectory(APP_DIR)
->addDirectory(LIBS_DIR)
->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon');
$container = $configurator->createContainer();
// Get application
$application = Environment::getApplication();
$router = $application->getRouter();
// DiBi Connect
dibi::connect( $container->params['database'] );
// Home route
$router[] = new Route('index.php', 'Front:Default:default', Route::ONE_WAY);
// Admin module router
$router[] = $adminRouter = new MultiRouter('Admin');
$adminRouter[] = new Route('admin/<presenter>/<action>/', 'Homepage:default');
// Front module router
$router[] = $frontRouter = new MultiRouter('Front');
$frontRouter[] = new Route('registrace/', 'Registration:default');
$frontRouter[] = new Route('<url>/', 'Article:default');
$frontRouter[] = new Route('<presenter>/<action>/', 'Homepage:default');
// Configure and run the application!
$container->application->run();
?>
- natrim
- Člen | 73
problém je v tom
$configurator->enableDebugger($configurator::DEVELOPMENT, __DIR__ . '/../logger');
ta metoda enableDebugger je totiz:
public function enableDebugger($logDirectory = NULL, $email = NULL)
tzn. to změn na
$configurator->enableDebugger(__DIR__ . '/../logger');
příště použij nějaké IDE které umí napovídat správné metody .)
Editoval natrim (1. 6. 2012 9:55)
- wsshark
- Člen | 6
stejně to tam je pořád
Warning: require(): open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/clients/client7/web36/app:/var/www/clients/client7/web36/libs:/var/www/clients/client7/web36/web:/var/www/clients/client7/web36:/var/www/clients/client7/web36/tmp:/var/www/petrova-pojistka.cz/web:/var/www/petrova-pojistka.cz:/srv/www/petrova-pojistka.cz:/srv/www/petrova-pojistka.cz/web:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client7/web36/libs/Nette/Diagnostics/Bar.php on line 76
už netuším čím by to mohlo být
bootstrap jsem změnil takto jakmile tam dám false tak to hodí basedir
restriction
<?php
// Enable Nette Debugger for error visualisation & logging
$configurator->setProductionMode(true);
$configurator->enableDebugger(__DIR__ . '/../logger');
?>
Editoval wsshark (1. 6. 2012 13:22)
- natrim
- Člen | 73
nemáš náhodou nette někde ve společné složce pro víc projektů?
pokud ano tak i ta složka musí bejt v open_basedir
a neřikej pořád to tam je, je to pokaždé jiná chyba .)
jinak já mam basediry např:
/var/www/clients/client41/web94/web:/var/www/clients/client41/web94/tmp:/var/www/domena.cz/web:/srv/www/domena.cz/web:/usr/share/php5:/tmp
a nette normálně funguje
Editoval natrim (1. 6. 2012 14:37)