DeluXe Network Forums
March 12, 2010, 08:43:59 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Please do not add ads in your signature!
 
   Home   Help Search Members Login Register  
Pages: [1]
  Print  
Author Topic: PHP file/directory creation  (Read 434 times)
Serious Worm
Newbie
*

Honor: 0
Offline Offline

Croatia Croatia

Posts: 2


View Profile
« on: August 08, 2009, 09:20:32 pm »

Hi. Smiley

I just made an topic about an error, that turned out to really stupid error/question on my part, so I deleted it. I had a forums account previously (SeriousWorm but I cannot find neither the password nor the email data that I used for registering back then).

My dxhost username is seriousworm.

Now, there's another question; I hope this one is not too stupid. Smiley

So, I have a script that extracts a module from an archive, creating a directory and copying all archives files to it in the process. I have created the base directory (/modules) using FTP, but the script should create /modules/<module_name>, however it cannot.

Here's the output of my custom error&exception handler script:

PHPError [E_WARNING: fopen() [function.fopen]: SAFE MODE Restriction in effect.  The script whose uid is 162535 is not allowed to access /usr/local/apache2/htdocs/seriousworm/modules/novosti owned by uid 48]
   in /usr/local/apache2/htdocs/seriousworm/includes/tar.class.php @ 208

Stacktrace:
#0 [internal function]: error_handler(2, 'fopen() [extractAll('modules/')
#3 /usr/local/apache2/htdocs/seriousworm/controlpanel.php(125): require('/usr/local/apac...')
#4 {main}

In short, it seems that I cannot create a folder using a script.
Obviously this is a severe limitation, meaning that I cannot install modules/themes at all. Automatically, anyway, since this is, after all, my own personal CMS and I can of course manually install all that stuff. Smiley
However, I was wondering if there was any way around it. Would it work if my install script also created the base directory (/modules)? Is the PID constant, for the lifetime of my php installation, or does it change on server restarts and such, meaning the same script that made the folder yesterday won't be able to (for example) delete the module tommorow? Will FTP work with all this, having absolute control?

Sorry for so many questions. Thanks in advance.
« Last Edit: August 08, 2009, 09:43:23 pm by Serious Worm » Logged
Michael
Administrator
Hero Member
*****

Honor: 11
Offline Offline

Germany Germany

Posts: 3250



View Profile WWW
« Reply #1 on: August 09, 2009, 02:00:46 pm »

yes, this is a server limitation because of safe_mode. I think the only way around it, is to use ftp to upload files (possible via php). The PID is constant.
Logged
Serious Worm
Newbie
*

Honor: 0
Offline Offline

Croatia Croatia

Posts: 2


View Profile
« Reply #2 on: August 09, 2009, 04:00:38 pm »

yes, this is a server limitation because of safe_mode. I think the only way around it, is to use ftp to upload files (possible via php). The PID is constant.

Thank you, thought so.

Actually, I think I'm gonna rewrite my cms so the install script not only installs the site itself but also creates all the directories that the script will write in the future (themes, modules). That way the script (server PID) should have ownership over those directories (I just hope I can manipulate them over FTP though if needed ^^).

Thanks again. Safe mode is not a problem at all - the script (cms) itself should be compatible to work with it (universal portability is my motto^^).
Logged
Pages: [1]
  Print  
 
Jump to:  

 

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.165 seconds with 17 queries.