Navigate
Home
ArticleWiki
Forum
Journal
Search
Newsletter
Links
Tech News
expertsrt.com
Welcome Guest.
Username:

Password:

Remember me

CHMOD an imported file list?
Welcome, Guest. Please login or register.
December 02, 2008, 06:08:53 AM
11304 Posts in 1248 Topics by 498 Members
Latest Member: katCheeme
Experts Round Table Network  |  Serverside Technology  |  PHP  |  CHMOD an imported file list? « previous next »
Pages: [1]
Author Topic: CHMOD an imported file list?  (Read 356 times)
SteveD

Offline Offline

Posts: 14


« on: June 15, 2006, 05:30:26 AM »

I am trying to chmod a huge list of files. I have my script setup right now so that it will import a .txt file that contains the patchs for all of the files.

I can use fopen to open the file and gather the list of file paths to be modified, but I can't figure out how to chmod a file. ftp_chmod is only in php5, and i'm running the latest stable version of php4.

I have tried
Code:
chmod($filename, $chmod);
to chmod the specific filename to the set chmod code, but it gives an error:
Quote
chmod(): Operation not permitted in...


Any pointers?
Logged
VGR
Mentor

Offline Offline

Posts: 682



WWW
« Reply #1 on: June 16, 2006, 11:54:18 PM »

chmod() IS the only way... And your user doesn't have enough privileges to perform the operation !

Remember your script runs "as" some unix user, the webserver's one. Run phpinfo() to know which one ("apache" section) this is in the worst case nobody/nobody. If it is the case, you're stuck. If it's a different user, try to give him higher privileges and run the server. This can become dangerous nevertheless...

You may try to change file ownership first though.
Logged

techie overlord, answers all kind of questions on http://www.europeanexperts.org
Pages: [1]
« previous next »
    Jump to: