FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Warning: mkdir(): File exists





gerimter
Warning: mkdir(): File exists in /home/gerimter/domains/men.com/public_html/banner_images/283/index.php on line 159 Notice: Undefined variable: dosyayol in /home/gerimter/domains/men.com/public_html/banner_images/283/index.php on line 161 Warning: copy(../up/resimgosteren/index.php): failed to open stream: No such file or directory in /home/gerimter/domains/men.com/public_html/banner_images/283/index.php on line 161


This error can be caused by?
sonam
Quote:
This error can be caused by?


Anything. Give us little bit more details. Is this forum, Yomla, Wordpress, anything else or your script. If is yours give us part of script to see what happened.

Sonam
jmraker
Quote:
Warning: mkdir(): File exists in /home/gerimter/domains/men.com/public_html/banner_images/283/index.php on line 159

It tried to make a directory but it already exists. The directory could already exists as a file. It can't create a directory that already exists as a file. You can avoid this warning by wrapping it around the result of a !file_exists() function call http://php.net/manual/en/function.file-exists.php or using @mkdir

Quote:
Notice: Undefined variable: dosyayol in /home/gerimter/domains/men.com/public_html/banner_images/283/index.php on line 161

The variable name dosyayol or $dosyayol is a misspell or was not initialized. To fix this goto line 161 and add a line that sets the variable to something like null or zero a few lines up and outside of any conditional statements.

Quote:
Warning: copy(../up/resimgosteren/index.php): failed to open stream: No such file or directory in /home/gerimter/domains/men.com/public_html/banner_images/283/index.php on line 161

The file does not exist. You can avoid this warning by wrapping it around the result of a file_exists() function call or add a @ before the function name to turn off error reporting for this function

If you want to blindly turn off all these you can call error_reporting(0); http://www.php.net/manual/en/function.error-reporting.php at the start of the program
LxGoodies
Hmm mkdir() just issues a warning, not a (stop) error.

I think Sonam is right.. we have to see more of the script, e.g.

It could be a non-existing path or filename/path conflict as you assume, but on the same line we also have a

Quote:
Undefined variable: dosyayol

.. also warning, but it could indicate an error in the file path or file name itself, instead of a non-existing source file.

If I were gerimter, I'd check the dosayol issue first, then test the script again.

Lx
ron_n_beau
gerimter wrote:
Warning: mkdir(): File exists in /home/gerimter/domains/men.com/public_html/banner_images/283/index.php on line 159 Notice: Undefined variable: dosyayol in /home/gerimter/domains/men.com/public_html/banner_images/283/index.php on line 161 Warning: copy(../up/resimgosteren/index.php): failed to open stream: No such file or directory in /home/gerimter/domains/men.com/public_html/banner_images/283/index.php on line 161

This error can be caused by?

Simple. You check first to see if the file exists, that's the way to avoid this type of error.

Code:

if(!file_exists('dir_name_here')) {take the actions here}
else {do something else}
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.