Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
New file creation using php
Old 08-24-2004, 07:30 PM New file creation using php
Junior Talker

Posts: 3
Trades: 0
Hi everyone,
i am trying desperatelly to create new file using fopen() function, but all the time getting permission error:
failed to open stream: Permission denied ....
situation is like this:
<?php
$file=fopen("directory/file.html","wt");
......
?>
script that is creating file is, as you may see, in parent folder of folder where i am trying to open file.
Folder "directory" is chmoded to 777.
If i try to create new file in same folder where script reside, it works. But i need to create it in subfolder. And NEW file must be created.
Any idea?
Thanks!
dstefanox is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-24-2004, 09:58 PM
Veter's Avatar
Super Talker

Posts: 147
Trades: 0
Try to use full path to the file like fopen("/home/user/www/directory/file.html","wt");
__________________
-=
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
=-
Veter is offline
Reply With Quote
View Public Profile Visit Veter's homepage!
 
Old 08-25-2004, 12:14 AM
mod
mod's Avatar
Novice Talker

Posts: 13
Trades: 0
my solution would be:
PHP Code:
<?
mkdir
("./directory/");
chdir("./directory/");
$file fopen("file.html""wt");
?>
filesystem functions explained
mod is offline
Reply With Quote
View Public Profile
 
Old 08-25-2004, 04:12 AM
Junior Talker

Posts: 3
Trades: 0
Thaks for posts,
but I have tried both this solutions al it still does not work!
I have also tried with ftp style acces, it also does not work...
dstefanox is offline
Reply With Quote
View Public Profile
 
Old 08-25-2004, 06:42 AM
Veter's Avatar
Super Talker

Posts: 147
Trades: 0
Check if safe mode or open basedir is enabled. If it is, add your new directory to the paths or disable it.
__________________
-=
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
=-
Veter is offline
Reply With Quote
View Public Profile Visit Veter's homepage!
 
Reply     « Reply to New file creation using php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21197 seconds with 12 queries