Reply to Re: [PHP] cgi chmod problem

Your name:

Reply:


Posted by Mikey on 09/26/05 01:35

Al wrote:

> I've got a php script that checks certain file permissions and if not
> OK for writing, chmods as required.
>
> I can use ftp_site(); but, prefer not to because the code is not
> readily transportable. Requires ftp login.
>
> I'd like a simple cgi file that can be called by my script as needed.
>
> My cgi file works OK if I call directly in my cgi-bin directory. e.g.,
>
>> $file= '/EditPage/test2.php';
>> $perms= 0746;
>
>
>> if(!file_exists($pfile)) echo "<div style=\"color:red;
>> font-weight:bold\">$pfile does not exist.</div>";
>>
>> chmod($pfile, $perms);
>>
>> echo "New file permissions for $pfile: ". substr(sprintf('%o',
>> fileperms($pfile)), -3);
>
>
> But, I can't get the cgi file to execute when using "include
> /path/perm.cgi". in the php test function.
>
> I guess it is because the cgi assumes it is running in the directory
> with the php that called it.
>
> Linux php3.9.11 virtual host
>
> Anyone have a suggestion.

My guess would be that your webserver isn't running as the same user as
your shell account - for details on how to fix this, please have go at STFA,

Mikey

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация