RE: [PHP] Please assist - been on this for hours - Permissions onserver
| From: | Steve Jackson | Date: | Fri, 11 Jul 2003 09:47:50 +0000 |
| Subject: | RE: [PHP] Please assist - been on this for hours - Permissions onserver | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-154846@lists.php.net to get a copy of this message | ||
Interesting.
Do I need to open an FTP connection do you think or use wrappers?
I tried this:
// Define the filename to write to.
$filename = 'test.txt';
// Open the file for overwriting.
$fp = fopen($filename, "w");
// Write the string to the file
$write = fputs($fp, $string);
// Close the file
fclose($fp);
// rename the filename in the root directory to the pagename
rename($filename, "$pagename.php");
$url = "172.16.2.4/~stephenj/misc/webpage";
$final_url = "ftp://$url/$pagename.php";
$fp2 = fopen("ftp://$url/cms/$pagename.php", "r");
<<<< Line 59.
$move = fputs($fp2, $final_url);
fclose($fp2);
// end of function.
and get a really odd error:
Warning:
fopen("ftp://172.16.2.4/~stephenj/misc/webpage/cms/this_wont_work.php","
r") - Inappropriate ioctl for device on line 59
Any ideas people?
Steve Jackson
Web Development and Marketing Manager
Viola Systems Ltd.
http://www.violasystems.com
stephen.jackson@violasystems.com
Mobile +358 50 343 5159
> -----Original Message-----
> From: Jason Wong [mailto:php-general@gremlins.biz]
> Sent: 11. heinäkuuta 2003 11:47
> To: php-general@lists.php.net
> Subject: Re: [PHP] Please assist - been on this for hours -
> Permissions onserver
>
>
> On Friday 11 July 2003 15:20, Steve Jackson wrote:
> > > Writing and moving require the same permissions. Also, there is a
> > > big difference between root and webroot. Which one are
> you talking
> > > about?
> >
> > Web root.
> > Sorry not the root directory of the server but the webroot. 1
> > directory back in fact is all I need so the structure would be:
> >
> > Web> Cms> generator.php
> > Web> generated.php
> >
> > So I can protect the CMS directory which currently needs to
> be chmod
> > 777 in order to write the page (at least that was the only
> way I could
> > get the write function to work) and then just have the
> written files
> > drop back into the web root so that if someone typed:
> >
> > http://www.mysite.com/generated.php
> >
> > They would get the page.
> >
> > Not (as I can currently do)
> > http://www.mysite.com/cms/generated.php
>
> You can use php's ftp functions to write the file into your
> webroot directory.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications
> Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
>
> ------------------------------------------
> /*
> One enemy soldier is never enough, but two is entirely too many
> -- Murphy's Military Laws n68
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>