Re: [PHP] PHP ignoring dotfiles, permissions
Just a hunch: do you get the same permissions output for the dotfiles as the normal ones? Thanks for the idea. I am not sure what you mean by permissions output but it is same owner and an ls -la gives -rwxr-xr-x 1 frank wheel 27 Apr 29 23:05 .mydotfile.php -rwxr-xr-x 1 frank wheel0 Apr 29 23:08 myfile.php - - - I BTW forgot to tell that I am on PHP 4.1.1 BTW - if I introduce syntax errors in .mydotfile they are ignored - it is like PHP does not read the content at all. But take away the leading dot and it is all as expected. Mystified! Frank * and then Frank declared .mydotfile.php: ?php echo I am here!; ? myfile.php: ?php require '.mydotfile.php'; ? When I run myfile.php there is no output! Just a hunch: do you get the same permissions output for the dotfiles as the normal ones? - -- Nick Wilson // www.explodingnet.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP ignoring dotfiles, permissions
At 30.04.2002 00:01, you wrote: Just a hunch: do you get the same permissions output for the dotfiles as the normal ones? Thanks for the idea. I am not sure what you mean by permissions output but it is same owner and an ls -la gives -rwxr-xr-x 1 frank wheel 27 Apr 29 23:05 .mydotfile.php -rwxr-xr-x 1 frank wheel0 Apr 29 23:08 myfile.php - - - I BTW forgot to tell that I am on PHP 4.1.1 BTW - if I introduce syntax errors in .mydotfile they are ignored - it is like PHP does not read the content at all. But take away the leading dot and it is all as expected. snip You know that dot files are hidden files ? I´m not shure, but I think they cannot be read by other users then these, where the user id is smaller then 500. If you want to use them, try to fread() them. If you try to hide a file for listing, set the approbiate filetype in the httpd.conf. So just rename this to mydotfile.secret and avoid listing via: Files ~ *.secret Order allow,deny Deny from all /Files then add this type to allow php to parse them AddType application/x-httpd-php .secret and include them as normal includemydotfile.secret HTH Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP ignoring dotfiles, permissions
You know that dot files are hidden files ? ... Yes, but I think this only is in contexts where directories are scanned by some application respecting this method of hiding - and that they otherwise are normal files when addressed explicitly. However, there seems to be something else about dotfiles and PHP (or FreeBSD or my particular systems) I don't know. If you want to use them, try to fread() them. Interesting idea. I will play with that. - - - Until something is clearer I recommend PHP-people using require '.mydotfile';or include '.mydotfile'; (I tried that as well) to watch out for unexpected behavior and maybe entirely avoid this in PHP-solutions intended to be portable. At least at my computer it wouldn't work and it is a very mainstream one! :-) - - - BTW - there is no problem if I give the full path, like require '/usr/home/frank/public_html/php_test/.mydotfile'; - - - Thanks to all for testing and suggestions. Frank HTH Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP ignoring dotfiles, permissions
what if you do this? require './.mydotfile.php'; ---John Holmes... - Original Message - From: Frank [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 1:59 PM Subject: Re: [PHP] PHP ignoring dotfiles, permissions You know that dot files are hidden files ? ... Yes, but I think this only is in contexts where directories are scanned by some application respecting this method of hiding - and that they otherwise are normal files when addressed explicitly. However, there seems to be something else about dotfiles and PHP (or FreeBSD or my particular systems) I don't know. If you want to use them, try to fread() them. Interesting idea. I will play with that. - - - Until something is clearer I recommend PHP-people using require '.mydotfile';or include '.mydotfile'; (I tried that as well) to watch out for unexpected behavior and maybe entirely avoid this in PHP-solutions intended to be portable. At least at my computer it wouldn't work and it is a very mainstream one! :-) - - - BTW - there is no problem if I give the full path, like require '/usr/home/frank/public_html/php_test/.mydotfile'; - - - Thanks to all for testing and suggestions. Frank HTH Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP ignoring dotfiles, permissions
At 14:55 29/4/2002 -0400, J. Holmes wrote: what if you do this? require './.mydotfile.php'; I tried that! No effect. But... Suddenly it worked! I now think I to some extent might have been fooled by my desktop PC caching information where it shouldn't. I have never seen it before (have set oplocks in Samba) - but maybe the PC was overloaded and forgot about immediate write to desk. This could explain some of the things. At least it suddenly worked when the files were edited in a shell editor instead of textpad. It could be that when I thought I tried different combinations from the shell command line I really didn't - as they might not have been written to desk. Windows is a little special with files without anything before the dot. I dont think it explains it all though. I also recall to have had problems with dotfiles earlier and then making them work. I will stay out of dotfiles in combination with PHP in the future, just to be safe. Thanks for the suggestion... Best Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php