共享主机上的Symfony2 open_basedir错误

时间:2015-01-28 23:47:37

标签: php apache symfony

您好我正在尝试在共享主机上安装symfony2,但我无法正常运行。似乎我得到一个open_basedir错误,我不知道如何解决它。我使用的是PhP 5.3,因此不应该成为问题。在本地电脑上它与wamp一起工作,但我需要在共享。我提到我问托管服务提供商,我不能打开open_basedir。这是错误:

ContextErrorException in ExecutableFinder.php line 59:
Warning: is_dir() [<a href='function.is-dir'>function.is-dir</a>]: open_basedir restriction in effect. File(/usr/php4/lib/php) is not within the allowed path(s): (/home/websoft:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp)
in ExecutableFinder.php line 59
at ErrorHandler->handleError('2', 'is_dir() [<a href='function.is-dir'>function.is-dir</a>]: open_basedir restriction in effect. File(/usr/php4/lib/php) is not within the allowed path(s): (/home/websoft:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp)', '/home/websoft/public_html/symfony24-test/vendor/symfony/symfony/src/Symfony/Component/Process/ExecutableFinder.php', '59', array('name' => 'java', 'default' => '/usr/bin/java', 'extraDirs' => array(), 'searchPath' => array('/home/websoft', '/usr/lib/php', '/usr/php4/lib/php', '/usr/local/lib/php', '/usr/local/php4/lib/php', '/tmp'), 'dirs' => array('/home/websoft', '/usr/lib/php'), 'path' => '/usr/php4/lib/php'))
at is_dir('/usr/php4/lib/php') in ExecutableFinder.php line 59
at ExecutableFinder->find('java', '/usr/bin/java') in Configuration.php line 67
at Symfony\Bundle\AsseticBundle\DependencyInjection\{closure}() in VariableNode.php line 54
at VariableNode->getDefaultValue() in ArrayNode.php line 241
at ArrayNode->finalizeValue(array('debug' => true, 'use_controller' => array('enabled' => true), 'bundles' => array(), 'filters' => array('cssrewrite' => array()))) in BaseNode.php line 303
at BaseNode->finalize(array('debug' => true, 'use_controller' => array('enabled' => true), 'bundles' => array(), 'filters' => array('cssrewrite' => array()))) in Processor.php line 37
at Processor->process(object(ArrayNode), array(array('debug' => true, 'use_controller' => false, 'bundles' => array(), 'filters' => array('cssrewrite' => null)), array('use_controller' => true))) in Processor.php line 50
at Processor->processConfiguration(object(Configuration), array(array('debug' => true, 'use_controller' => false, 'bundles' => array(), 'filters' => array('cssrewrite' => null)), array('use_controller' => true))) in AsseticExtension.php line 44
at AsseticExtension->load(array(array('debug' => true, 'use_controller' => false, 'bundles' => array(), 'filters' => array('cssrewrite' => null)), array('use_controller' => true)), object(ContainerBuilder)) in MergeExtensionConfigurationPass.php line 50
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in MergeExtensionConfigurationPass.php line 39
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in Compiler.php line 117
at Compiler->compile(object(ContainerBuilder)) in ContainerBuilder.php line 614
at ContainerBuilder->compile() in bootstrap.php.cache line 2564
at Kernel->initializeContainer() in bootstrap.php.cache line 2343
at Kernel->boot() in bootstrap.php.cache line 2374
at Kernel->handle(object(Request)) in app_dev.php line 22

1 个答案:

答案 0 :(得分:3)

我有同样的问题,并删除Debug :: enable();来自app_dev.php解决了它。