search
HomeBackend DevelopmentPHP TutorialDISCUZ在win2003环境下 Unable to access ./include/common.inc._PHP

注:
理论上下面的方法可以可以的,但前提是保证你的php配置的没有错误,建议大家用新版的php版本,与discuz程序,相关的服务器相关软件可以到s.bitsCN.com下载。

这两天论坛经常报错误信息

Warning: require_once(./include/common.inc.php) [function.require-
once]: failed to open stream: No such file or directory in
E:\host\aydsw\index.php on line 12

Fatal error: require_once() [function.require]: Failed opening required
'./include/common.inc.php' (include_path='.;C:\php5\pear') in
E:\host\aydsw\index.php on line 12

我在网上查了一下,应该是权限问退,不知道论坛是否能用得上。

解决方法一:

其实这个问题不用说的那么复杂。导致这个问题是因为目录权限问题所致。
大家都知道通常在2003中的权限设置比较混乱。
形象点表达的解决方法是这样的:
比如:你的论坛放在WEBROOT的BBS目录下,如果你仅仅赋予了BBS目录INTERNET来
宾用户(或者你指定的用户)的访问权限,而BBS的上级目录webroot没有
INTERNET来宾用户(或者你指定的用户)访问权限就有上述问题出现。
只要赋予WEBROOT这个目录(就是论坛目录的上级目录)以INTERNET来宾权限(或
你指定的用户)问题即可解决!
原因是:官方把所有 php 文件里的 ./include/,如果改为 include/即可解决,
但总不能一个个替换吧,个人解决的办法,就是建个父目录了。

解决方法二:

今个服务器重装系统了
配置了php mysql 是win下的 可是访问dz(Discuz)论坛的时候出现如下错误:
Warning: require_once() [function.require-once]: Unable to access
./include/common.inc.php in E:\mysite\ceshi\index.php on line 12
Warning: require_once(./include/common.inc.php) [function.require-
once]: failed to open stream: No such file or directory in
E:\mysite\ceshi\index.php on line 12
Fatal error: require_once() [function.require]: Failed opening required
'./include/common.inc.php' (include_path='d:/php5/includes') in
E:\mysite\ceshi\index.php on line 12
此网站没有任何问题,提示的是文件没有找到

弄了半天终于解决了
问题是:
1、IIS6.0有没启用父路径
2、权限问题给了users权限(注上机目录也必须有权限,不然就出现这个问题)

其它参考:

把论坛转移到了自己的服务器上,服务器是win2003+iis+php+mysql,但访问论坛总是提示以下信息:

Warning: require_once() [function.require-once]: Unable to access ./include/common.inc.php in E:\im286\index.php on line 12
Warning: require_once(./include/common.inc.php) [function.require-once]: failed to open stream: No such file or directory in E:\im286\index.php on line 12

Fatal error: require_once() [function.require]: Failed opening required './include/common.inc.php' (include_path='d:/php5/includes') in E:\im286\index.php on line 12
方法一:在网上也google baidu了一下 出现这个问题的还真不少,修改./include/为include/问题解决,但rewrite加载总是不成功,倒腾了半天才发现原来是权限问题,给设置了veryone权限,一切就ok了,最后提醒大家,iis要启用父路径。

方法二:
1、IIS6.0有没启用父路径
2、权限问题给了users权限(注上机目录也必须有权限,不然就出现这个问题)

方法三:
是权限问题,在上级目录加了everyone读权限,仅针对上级目录,但非常久,等不及,停掉。换了个目录为e:\im286\bbs,给上级目录everyone读权限,访问,提示:
No input file specified.

方法四:
搜 索一下,1种说是把php.ini中的doc_root ="注释掉,我看了下本身就是注释掉的,不是这个问题。第2种是说应用池的问题。IIS新建了一个应用池,给这个站点用。刷新,网站可以访问了。再试一 下,是不是和上级目录权限有关,把上级目录everyone读权限去掉,再刷新,又提示和上面的错误一样了,确定与此有关了,然后再加上,问题解决。

方法五:
我这也出现这种问题,刚刚找了半天没结果,试着改(./include/common.inc.php),结果成功了,有问题的不妨试试!
修改 common.inc.php里所有 './ 为 '/ (就是把中间的点去掉)

方法六:终极解决方法
这样的问题如果别的程序正常,但只有一些php系统有问题,这里以phpmyadmin为例,如当前目录是d:\werroot\phpmyadmin只要将在phpmyadmin目录里面再创建一个目录web,然后iis中定位路径为d:\werroot\phpmyadmin\web就可解决问题。这个应该是程序中用了./的问题。

Statement
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
How to make PHP applications fasterHow to make PHP applications fasterMay 12, 2025 am 12:12 AM

TomakePHPapplicationsfaster,followthesesteps:1)UseOpcodeCachinglikeOPcachetostoreprecompiledscriptbytecode.2)MinimizeDatabaseQueriesbyusingquerycachingandefficientindexing.3)LeveragePHP7 Featuresforbettercodeefficiency.4)ImplementCachingStrategiessuc

PHP Performance Optimization Checklist: Improve Speed NowPHP Performance Optimization Checklist: Improve Speed NowMay 12, 2025 am 12:07 AM

ToimprovePHPapplicationspeed,followthesesteps:1)EnableopcodecachingwithAPCutoreducescriptexecutiontime.2)ImplementdatabasequerycachingusingPDOtominimizedatabasehits.3)UseHTTP/2tomultiplexrequestsandreduceconnectionoverhead.4)Limitsessionusagebyclosin

PHP Dependency Injection: Improve Code TestabilityPHP Dependency Injection: Improve Code TestabilityMay 12, 2025 am 12:03 AM

Dependency injection (DI) significantly improves the testability of PHP code by explicitly transitive dependencies. 1) DI decoupling classes and specific implementations make testing and maintenance more flexible. 2) Among the three types, the constructor injects explicit expression dependencies to keep the state consistent. 3) Use DI containers to manage complex dependencies to improve code quality and development efficiency.

PHP Performance Optimization: Database Query OptimizationPHP Performance Optimization: Database Query OptimizationMay 12, 2025 am 12:02 AM

DatabasequeryoptimizationinPHPinvolvesseveralstrategiestoenhanceperformance.1)Selectonlynecessarycolumnstoreducedatatransfer.2)Useindexingtospeedupdataretrieval.3)Implementquerycachingtostoreresultsoffrequentqueries.4)Utilizepreparedstatementsforeffi

Simple Guide: Sending Email with PHP ScriptSimple Guide: Sending Email with PHP ScriptMay 12, 2025 am 12:02 AM

PHPisusedforsendingemailsduetoitsbuilt-inmail()functionandsupportivelibrarieslikePHPMailerandSwiftMailer.1)Usethemail()functionforbasicemails,butithaslimitations.2)EmployPHPMailerforadvancedfeatureslikeHTMLemailsandattachments.3)Improvedeliverability

PHP Performance: Identifying and Fixing BottlenecksPHP Performance: Identifying and Fixing BottlenecksMay 11, 2025 am 12:13 AM

PHP performance bottlenecks can be solved through the following steps: 1) Use Xdebug or Blackfire for performance analysis to find out the problem; 2) Optimize database queries and use caches, such as APCu; 3) Use efficient functions such as array_filter to optimize array operations; 4) Configure OPcache for bytecode cache; 5) Optimize the front-end, such as reducing HTTP requests and optimizing pictures; 6) Continuously monitor and optimize performance. Through these methods, the performance of PHP applications can be significantly improved.

Dependency Injection for PHP: a quick summaryDependency Injection for PHP: a quick summaryMay 11, 2025 am 12:09 AM

DependencyInjection(DI)inPHPisadesignpatternthatmanagesandreducesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itallowspassingdependencieslikedatabaseconnectionstoclassesasparameters,facilitatingeasiertestingandscalability.

Increase PHP Performance: Caching Strategies & TechniquesIncrease PHP Performance: Caching Strategies & TechniquesMay 11, 2025 am 12:08 AM

CachingimprovesPHPperformancebystoringresultsofcomputationsorqueriesforquickretrieval,reducingserverloadandenhancingresponsetimes.Effectivestrategiesinclude:1)Opcodecaching,whichstorescompiledPHPscriptsinmemorytoskipcompilation;2)DatacachingusingMemc

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Atom editor mac version download

Atom editor mac version download

The most popular open source editor