PHP error require_once when including file in parent folder

I have the following file structure

- plugins
- inParent.php
---- Download
------ inSame.php
------ Uploadify.php

This function worked smoothly until yesterday. But now, if I try to include inParent.php in uploadify.php using require_once ('../inparent.php) , It is giving me a stupid error ... I suppose ...

Warning: require_once(../inParent.php) [function.require-once]: failed to open stream: No such file or directory in /home/user/public_html/plugins/uploadify/uploadify.php on line 3 

But the file definitely exists ...

The same code when using inSame.php does not show errors and works fine.

I figured that there might be a problem with the file resolution .. But everything is fine .. all related files have 755/644 permissions.

In addition, the move_uploaded_file function also stopped working.

All code worked until yesterday. I have not changed anything.

I tried everything and I don’t know what exactly happened.

Please help me with friends .. :(: (

+4
source share
2 answers

I googled and found this: require_once __DIR__.'/../inParent.php';

+14
source

If it worked yesterday, and you are sure that you have not changed anything, try restarting the server first.

Secondly, after the request, try to use the full path instead .. Usually I create a file with my root paths and refer to them instead of using. / And ../

0
source

Source: https://habr.com/ru/post/1432002/


All Articles