Find the answer to your Linux question:
Results 1 to 6 of 6
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    PHP not parsing outside of /var/www

    I have some software installed that symlinks from /var/www/xxxxx to pages elsewhere.

    I can't see how to get PHP to parse these files, it only seems to do it within /var/www

    I am sure this is obvious to someone smarter than me!

    Any ideas?

  2. #2
    An update....

    It is parsing now in the same folder but only the file i create. The softwares files still insist on downloading instead. Same user:group for all.

  3. #3
    Ain't it finding the file, or ain't it running the script and instead showing it to you?

  4. $spacer_open
  5. #4
    One thing you could try to do would be to configure apache to look at the pages elsewhere rather than symlinking from /var. It's probably a PHP configuration issue. More information would be useful.

  6. #5
    Just Joined!
    Join Date
    Mar 2009
    Santa Cruz, California
    For a Debian or Ubuntu or related distro, look for an example in /etc/apache2/conf.d/apache2-doc - this provides an alias allowing access as Apache HTTP Server Version 2.2 Documentation - Apache HTTP Server to the actual manual directory, and then allows symlinks under that directory.

    Alias /manual /usr/share/doc/apache2-doc/manual/

    <Directory "/usr/share/doc/apache2-doc/manual/">
    Options Indexes FollowSymlinks
    AllowOverride None
    Order allow,deny
    Allow from all
    AddDefaultCharset off

    The FollowSymlinks directive is what you want.

  7. #6
    Just Joined!
    Join Date
    Mar 2009
    Santa Cruz, California
    Another related issue is enabling PHP in user directories (like http://myserver/~mylogin/somefile.php)

    For this you should enable php and userdir in /etc/apache2/mods-enabled, using the a2enmod utility or the ln command to link to the module in /etc/apache2/mods-available.

    THEN, in /etc/apache2/mods-enabled/, comment out the lines below:

    # To re-enable php in user directories comment the following lines
    # (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
    # prevents .htaccess files from disabling it.
    # <IfModule mod_userdir.c>
    # <Directory /home/*/public_html>
    # php_admin_value engine Off
    # </Directory>
    # </IfModule>

    and restart Apache2

Posting Permissions

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