Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Apache and php~

  1. #1
    New Coder
    Join Date
    Dec 2008
    Location
    Western Belgium
    Posts
    32
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Apache and php~

    Hi,

    I have a problem to configure apache (on Suse) to ignore php~ files.
    I'm running Apache and php without problems, but my editors (gedit and jed) make me a little one.

    Both editors are making backup files as php~ (some others also - I suppose).
    By default if use www.domain.com/page.php there is no problems, but when I use www.domain.com/page.php~I get php~sourcecode to read as a webpage.

    Now I have ignore this so, that Apache will use php to show this files
    AddType application/x-httpd-php .php~

    but I like to apache skip them totally!

    I have also try to use filesmatch directive on httpd.conf as

    <FilesMatch "\.php~$">
    Order allow,deny
    Deny from all
    </FilesMatch>

    It works, but only if files are something else as php~. When using sample above, apache shows php~code as without directive

    Ideas?

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by b_r_h View Post
    Hi,

    I have a problem to configure apache (on Suse) to ignore php~ files.
    I'm running Apache and php without problems, but my editors (gedit and jed) make me a little one.

    Both editors are making backup files as php~ (some others also - I suppose).
    By default if use www.domain.com/page.php there is no problems, but when I use www.domain.com/page.php~I get php~sourcecode to read as a webpage.

    Now I have ignore this so, that Apache will use php to show this files
    AddType application/x-httpd-php .php~

    but I like to apache skip them totally!

    I have also try to use filesmatch directive on httpd.conf as

    <FilesMatch "\.php~$">
    Order allow,deny
    Deny from all
    </FilesMatch>

    It works, but only if files are something else as php~. When using sample above, apache shows php~code as without directive

    Ideas?
    a better solution is to clean the backup files( *~ in your case *.php~) and for this you can do from comand line:
    Code:
    find /var/www/ -name "*~" -exec rm -vf {} \;
    you must have root access and must replace /var/www/ with path to your directory.

    best regards

  • Users who have thanked oesxyl for this post:

    b_r_h (01-16-2009)

  • #3
    New Coder
    Join Date
    Dec 2008
    Location
    Western Belgium
    Posts
    32
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by oesxyl View Post
    a better solution is to clean the backup files( *~ in your case *.php~) and for this you can do from comand line:
    Code:
    find /var/www/ -name "*~" -exec rm -vf {} \;
    you must have root access and must replace /var/www/ with path to your directory.

    best regards
    Yeps you are right, but I think it can also do apache?

  • #4
    New Coder
    Join Date
    Dec 2008
    Location
    Western Belgium
    Posts
    32
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Anybody


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •