English 中文(简体)
要求: 气ux(Papache2)
原标题:require_once() Error in linux (apache2)
  • 时间:2010-09-28 19:22:42
  •  标签:
  • php

While i try to deploy the code devloped on wamp server on the dev machine on linux , i get this error: Warning: require_once(/PHP file) [function.require-once]: failed to open stream: No such file or directory in /var/www/proj/index.php on line 38

致命错误:要求: 未能开张 :/var/www/proj:/var/www/proj/framework: ) in /var/www/proj/index.php on line 38

现在,PHP文档一号是“/var/www/proj/framework

问题回答

You have just supplied wrong filename.
Use proper path to this PHP file

require_once("/PHP file")

正在使用一条绝对的道路,并在服务器档案系统根名录中寻找PHP文档。

require_once("./PHP file")

require_once("PHP file")

is a relative path that would search f或 PHP file using the include path

而且,为了进一步理解这一read,不要忘记Windows对个案敏感的 care,而“Unix/HCH”确实!

这对我来说,是利用PHP的灵魂。

require once __DIR__ . "/directory/name_file.php";


I have also faced the same problem earlier.
I found on my program that, all path was included using "" on Windows system and linux supports "/" path separator.
Please check once that all you include path is having "/" path separator.





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签