Solved

Can't mkdir with PHP on Apache server and code throws no errors....

Posted on 2009-07-13
3
373 Views
Last Modified: 2013-12-13
I have a fairly simple script that creates a directory depending on the text entered in a field. But the mkdir will not work. It works on our local test server and another server we have but it will not work on the Verio VPS server I am working on.

I can't mkdir or upoad a file using php.. it does not  throw any errors and enteres the information in the MySQL database just fine. It just won't mkdir or upload.. The script follows through just fine and gives no errors.

I have checked the php.ini and uploads are on and size is fine. Even when I dumb the script down to just

<?php
mkdir ("newdirectory");
?>

It wont work.

Any thing I may be missing?
$uploaddir = $_POST["room"];
$uploaddir2 = "'" . $_POST["room2"] . "'";
$pathway = ("'" . "/backoffice/rooms/" . $_POST["room2"] . "'");
$docsdir = $uploaddir . "/docs";
$projecto = $_POST["project"];
mkdir($uploaddir, 0775, true);
mkdir($docsdir, 0775, true);

Open in new window

0
Comment
Question by:rcimasi
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
ali_kayahan earned 500 total points
ID: 24840165
Did you try to set chmod 777 for the folder that you try to create folder in ?
0
 

Author Comment

by:rcimasi
ID: 24840219
What kind of security risk can I expect from a chmod 777?
0
 
LVL 14

Expert Comment

by:ali_kayahan
ID: 24840426
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question