php中php.ini遇到的问题
我在php.ini中配置了include_path的路径(有unix和windows我win7的系统配置了windows下的),在php使用include时,在配置的路径下的文件却说找不到,还是得用绝对路径,或者放在在同一级的文件夹下。
回复讨论(解决方案)
include_path表示include命令引用某个文件的路径,设置了这个值之后,就可以在php代码中写相对路径导入某个文件。在windows下,比如说,include_path为“c:\code\php”,include命令写成include=“file1.php”,这样导入的文件的真正路径是“c:\code\php\file1.php”。
目???
include/function.php
www/index.php
function.php
<?phpfunction test(){ echo 'Hello World';}?>
index.php include function.php
<?phpinclude "../include/function.php";test();?>
include_path表示include命令引用某个文件的路径,设置了这个值之后,就可以在php代码中写相对路径导入某个文件。在windows下,比如说,include_path为“c:\code\php”,include命令写成include=“file1.php”,这样导入的文件的真正路径是“c:\code\php\file1.php”。
是的。。。找到问题了,是我太马虎,php.ini中注释掉了没注意。解开后确实是这样。今天老大和我说在ini中配置include_path被建议最好别开,每次include,require都去查找那个路径很不好,自己设置一个路径常量用比较好,是这样吗?
Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.
