【Nosuchfileordirectory#include<ext/standard/php_smart_strh>】教程文章相关的互联网学习教程文章

PHP include_path主值来自哪里?【代码】

通过phpinfo,我获得了include_path Master Value的以下内容..:/usr/share/pear:/usr/share/php它似乎没有在任何地方设置… php ini已将所有include_path(s)注释掉,我的应用程序没有手动设置,apache conf / php conf /其他各种conf / ini不设置它,搜索时没有结果for set_include_path或phpvalue或ini_set等. 任何其他“include_path”的想法都可能被设置?我特别询问主人价值. (我在CentOS 5.4上)解决方法:它是在构建时配置的.您可以...

php – set_include_path()无法使用相对require()【代码】

我“需要”一个具有自己的require()调用的文件.但是调用set_include_path()不能使用require()中的相对路径.不幸的是,我无法控制所需的代码文件. C:/myapp/index.php – 我的代码set_include_path(get_include_path() . ';C:/app/subfolder'); require('C:/app/subfolder/index.php');C:/app/subfolder/index.php – 第三方代码(无控件)require('../config.php'); // Require file located at C:/app/config.php结果: 无法打开...

PHP require_once或include_once嵌套

目录结构, > A.php>文件夹 > B.php> C.php A.php包括B.php和B.php包括C.php. 但B.php需要包括相对于A.php的C.php.有没有什么方法可以包括相对于B.php的C.php?解决方法:您可以包括使用__DIR__或dirname(__ FILE__). 从the manual起The directory of the file. If usedinside an include, the directory ofthe included file is returned. This isequivalent to dirname(__FILE__).

使用php include或javascript ajax【代码】

我正在创建一个应用程序,我试图弄清楚最好的方法是我加载json文件. 我正在考虑的一种方法是php includevar jsonFile = <?php echo include "jsonFile.json";?>; var jsonFile_2 = <?php echo include "jsonFile2.json";?>;//and more possible includes或Ajax更好?$.ajax({type: "GET",url: "jsonFile.json",dataType: "json",success: function () {//more nested ajax calls }});或者两者的混合? 到目前为止,有3个json文件将被...

php – 在哪里定位include / require语句?【代码】

您是否将所有include_once和require_once定位在文件的开头,因此很清楚它的依赖性是什么,或者您是否将它们放在使用它们的最本地范围内,以提高效率? 假设我有一个错误处理文件,它有一个显示错误信息的功能 – 你会……require_once('error_handling.php'); ... lots of code ... if ($should_be_true === False) {ReportErrror(); // declared in error_handling.php }或者你呢... lots of code ... if ($should_be_true === False...

未知:在第0行的未知中打开所需的’0ff'(include_path =’.:/ tmp:/usr/lib / php:/usr/local/lib / php’)失败【代码】

我今天遇到了以下错误.我的PHP程序没有任何变化.Warning: Unknown: failed to open stream: No such file or directory inUnknown on line 0 Warning: Unknown: failed to open stream: No such file or directory inUnknown on line 0 Fatal error: Unknown: Failed opening required ‘0ff’(include_path=’.:/tmp:/usr/lib/php:/usr/local/lib/php’) in Unknown online 0….几个小时后……服务器管理员在他的观点上说’没有问...

php – include()/ require()带有“副作用”是一种不好的做法吗?【代码】

正在做类似的事情_________________________ //index.php ... require("header.php"); ... __________________________________________________ //header.php printHeader()function printHeader(){echo 'something';... } _________________________被认为是避免不良做法? 我个人认为执行require()(或require_once()或include(),这不是点)调用应该只添加一个“链接”到其他函数/对象,永远不会自己执行任何东西.换句话说,在我看来...

085-PHP文件引用include(二)【代码】【图】

01.php<?phpfunction foo() {global $color;include 02.php;echo "A $color $fruit"; }foo(); // A green apple echo "A $color $fruit"; // A green?>02.php<?php$color = green;$fruit = apple;?>

php – 为什么include()不允许工作setcookie?【代码】

参见英文答案 > How to fix “Headers already sent” error in PHP 11个我需要在我的页面中设置cookie,但它会返回Warning: Cannot modify header information - headers already sent by (output started at /home1/bsam/public_html/24kadr/index.php:1) in /home1/bsam/public_html/24kadr/basic_login.php on line 35在第1行我有include 'basic_login.php'; 但即使我删除include,ir也会在...

PHP – 将GET变量作为路径发送到Include / Require语句中【代码】

我有一种情况,我想使用php文件“query.php”来查看$_POST或$_GET值作为MySQL查询.它看起来像这样:<?php //verify data has been sent via POST or GET and set strings //find supplied table name if(isset($_POST['tblName'])){$strSuppliedTableName = $_POST['tblName']; } if(isset($_GET['tblName'])){$strSuppliedTableName = $_GET['tblName']; } else{$strSuppliedTableName = 'roles'; }//find supplied field name or ...

PHP set_include_path配置【代码】

我遇到了set_include_path的问题,我读了很多关于这个问题的消息,但没有一个对我有用.我在Debian上,我的根目录将设置为/ home / project / 所以我尝试了这4种不同的东西:ini_set("include_path", '/home/project'); ini_set("include_path", '.:/home/project'); set_include_path('.:/home/project'); set_include_path('/home/project'); set_include_path(get_include_path().PATH_SEPARATOR.'/home/project');但没有一个…当我...

wordpress – 错误:在wp-includes / post.php中,只能通过引用返回变量引用【代码】

当我在我的WordPress设置中放入PHP错误报告时,我一直收到此错误. 注意:在3394行的/Users/admin/Sites/wp-includes/post.php中,只能通过引用返回变量引用 我觉得它与分类法及其分层设置有关. 我正在尝试在我正在编写的插件中跟踪它一段时间. 这些是WP Core中的实际代码行,返回在excact行上.// Make sure the post type is hierarchical$hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) );if ( !in_arr...

php – includer vs. return include【代码】

当你需要包含一个文件时,只需使用“include file”,当你需要返回一个配置文件时,你必须使用“return include file”…通常我有一个函数“loader($file,$return = false)”,其中我使用$return返回include或不.我的问题是,即使对于未配置的文件,如果保持返回包含文件存在问题:return include "class/view.php" return include "config/test.php"谢谢解决方法:从php.net开始:Handling Returns: include returns FALSE on failure an...

无法设置PHP include_path【代码】

我已经将所有文件上传到var / www / html和我的一个php文件中,我有这行:require_once('libraries/stripe/init.php');我的文件夹的结构列出这个:www-html/-libraries-> Stripe -> init.php-register.php我一直收到此错误消息:Warning: require_once(libraries/Stripe/init.php): failed to open stream: No such file or directory in /var/www/html/register.php on line 116 Fatal error: require_once(): Failed opening requ...

php – 与eval()和include()的命名空间不能按预期工作【代码】

我只是搞乱了,我遇到了这个: 不行<?php namespace first{include 'data:text/plain, <?php function a_func(){echo "hi";}';a_func(); } namespace second{include 'data:text/plain, <?php function a_func(){echo "bye";}';a_func(); }[29-Apr-2016 14:12:42 America/New_York] PHP Fatal error: Cannot redeclare a_func() (previously declared in data:text/plain, <?php function a_func(){echo “hi”;}:1) in data:text/...