简体   繁体   中英

Creating folder outside /var/www

I'm trying to create folder outside of my www folder where are stored my php scripts.

<?php

$subfolder = $_POST['subfolder'];
mkdir("../Norme/".$subfolder, 0755, true);

?>

If I chech inside Norme folder there are no new folders created. Folder Norme is placed in /var/Norme.

If I change mkdir statement to:

mkdir("Norme/".$subfolder, 0755, true);

The script creates folder Norme and given subfolder inside /var/www

How to set different folder than www folder?

Josef, Just change your code to:

`mkdir("/var/Norme/".$subfolder, 0755, true);

It should work. And make sure that the folder Norme has proper rights/permissions to create the folder inside it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM