62731

No such file or directory error using mkdir

Question:

I am encounter with a problem when i give full path to mkdir it says No such file or directory but when i am providing the same back but first going back to one directory it work

I am just want to ask why this is not working

$name = "4ftwx"; // dir name $domain = $_SERVER['HTTP_HOST']; mkdir($domain.'/project/'.$name); //localhost/project/4ftwx

but it work when i call like this

mkdir('../project/'.$name);

both pointing same path then why it is not working

Answer1:

Maybe you should use $_SERVER['DOCUMENT_ROOT'] to get the document root directory under which the current script is executing.

Recommend

  • create NodeSet in XSLT from PHP function
  • Typescript: How to map over union array type?
  • Enabling CORS using Spring Boot 1.3.3-RELEASE
  • get back to normal after the traverse in threejs
  • Drag and drop in listview C# [duplicate]
  • Play sound on click in A-Frame
  • Use count or have a field that tallies?
  • MVC5 custom error page
  • Collecting attributes from dask dataframe providers
  • Detecting cells in column that cause error in SQL
  • Unable to properly install binary edition of Apache Ant
  • android: disable opengl ES context switch upon device rotation
  • How to prepare a C++ string for sql query
  • mail server requires authentication when attempting to send to a non-local e-mail address when using
  • android-support-v7-appcompat has same attrs as actionbarsherlock library
  • Guava how to copy all files from one directory to another
  • Why people use prototype in javascript when it is easy to inherit using apply () and call () methods
  • Changing Jupyter Notebook start up folder by modifying “start in” not working any more
  • jwtBearer bearer token with rc-1 update to ASP.Net 5
  • List images(01.png) and descriptions(01.txt) from directory
  • Web.config system.webserver errors
  • Copy to all folders batch file?
  • Should I or shouldn't I use the CachingConnectionFactory with hornetq 2.4.1
  • Make VS2015 use angular-cli ng at build time in a .NET project
  • How to test if a URL from an Eclipse bundle is a directory?
  • Email verification using google app script and google forms
  • Checking free space on FTP server
  • Change Inet root folder for iis 7
  • Arrow is showed instead of the material design version hamburger icon. Why doesn't syncState in
  • How to model a transition system with SPIN
  • Updated Ionic CLI but shows previous version (Windows)
  • How to make Safari send if-modified-since header?
  • ORA-29908: missing primary invocation for ancillary operator
  • Matrix multiplication with MKL
  • Buffer size for converting unsigned long to string
  • Hits per day in Google Big Query
  • How do you join a server to an Active Directory (domain)?
  • File not found error Google Drive API
  • reshape alternating columns in less time and using less memory
  • Converting MP3 duration time