`require`在php中不起作用 [英] `require` is not working in php

查看:139
本文介绍了`require`在php中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  PHP致命错误:require():无法打开所需的' /base/data/home/apps/s~civic-planet-191520/20180221t115719.407805658953142647/web-service/web/../vendor/autoload.php'(include_path ='。; / base / data / home / apps /s~civic-planet-191520/20180221t115719.407805658953142647/;/base/php_experiment_runtime/sdk')

我的 autoload.php 文件放置在 vendor 目录中,并且我正在加载 autoload。 php 文件来自 web / index.php 文件。 Web 供应商目录都位于同一层。检查下面的截图。



我使用这个php代码来加载 autoload.php 文件。

  require __DIR __。/../ vendor / autoload.php; 

我也尝试过:

  require(__ DIR__。'/../vendor/autoload.php'); 

我的项目在Google应用程序引擎上加载。



解决方案

全局安装Composer可执行文件用于依赖管理
Google中的相同PHP快速入门


This is the error which i am fetching right now.

PHP Fatal error: require(): Failed opening required '/base/data/home/apps/s~civic-planet-191520/20180221t115719.407805658953142647/web-service/web/../vendor/autoload.php' (include_path='.;/base/data/home/apps/s~civic-planet-191520/20180221t115719.407805658953142647/;/base/php_experiment_runtime/sdk')

My autoload.php file is placed in vendor directory , and i am loading autoload.php file from web/index.php file . Web and vendor directory both are at same lavel. Check below screenshot.

I am using this php code for load autoload.php file.

require __DIR__."/../vendor/autoload.php";

I have also try:

require(__DIR__. '/../vendor/autoload.php');

My project is load on google app engine.

解决方案

Install the Composer executable globally for the dependency management the same as it is done in this Google PHP quickstart.

这篇关于`require`在php中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆