Home > Backend Development > PHP Tutorial > php中php.ini遇到的有关问题

php中php.ini遇到的有关问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 12:04:47
Original
873 people have browsed it

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

<br /><?php<br />function test(){<br />    echo 'Hello World';<br />}<br />?><br />
Copy after login


index.php include function.php
<br /><?php<br />include "../include/function.php";<br />test();<br />?><br />
Copy after login

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
include error
From 1970-01-01 08:00:00
0
0
0
How to include a file in ubuntu?
From 1970-01-01 08:00:00
0
0
0
Why can't I load the content in include?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template