Find the answer to your Linux question:
Results 1 to 6 of 6
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2010
    Posts
    9

    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
    Just Joined!
    Join Date
    Dec 2010
    Posts
    9
    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
    Linux User
    Join Date
    Dec 2009
    Posts
    262
    Ain't it finding the file, or ain't it running the script and instead showing it to you?

  4. #4
    Just Joined!
    Join Date
    Jun 2008
    Posts
    9
    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.

  5. #5
    Just Joined!
    Join Date
    Mar 2009
    Location
    Santa Cruz, California
    Posts
    76
    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
    </Directory>

    The FollowSymlinks directive is what you want.

  6. #6
    Just Joined!
    Join Date
    Mar 2009
    Location
    Santa Cruz, California
    Posts
    76
    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>
    </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
  •