The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Apache Alias directive not working un EA4 with PHP-FPM

Discussion in 'EasyApache' started by outofcontrol, Apr 24, 2017.

Tags:
  1. outofcontrol

    outofcontrol Member

    Joined:
    May 18, 2009
    Messages:
    22
    Likes Received:
    1
    Trophy Points:
    53
    Location:
    Montreal
    Under EA3 we had an Alias in /usr/local/apache/conf/userdata/ssl/2/user/domain/domain.conf like this:

    Code:
    Alias /wiki /home/user/public_html/wiki_2
    This worked well. Under EA4 I've put the alias directive under /etc/apache2/conf.d/userdata/ssl/2_4/user/domain/wiki.conf and rebuilt and restart apache.

    However, we are getting this error in the browser:
    Code:
    No input file specified.
    And in the /var/log/apache2/error_log I get this:
    Code:
    Got error 'Unable to open primary script: //home/user/public_html/wiki_2/index.php (No such file or directory)\n'
    Ownership of the file is correctly I think, owned by user:user and chmod 644. Not sure where else to look to see why this doesn't work. Anyone have any ideas on how to make this work?
     
  2. outofcontrol

    outofcontrol Member

    Joined:
    May 18, 2009
    Messages:
    22
    Likes Received:
    1
    Trophy Points:
    53
    Location:
    Montreal
    Just discovered that if I try and load a non-PHP file within /wiki, it loads perfectly fine. So this issue is only affecting PHP files. Which seems to indicate it's a PHP-FPM misconfiguration somewhere. Hopefully this will in trouble shooting this.
     
  3. outofcontrol

    outofcontrol Member

    Joined:
    May 18, 2009
    Messages:
    22
    Likes Received:
    1
    Trophy Points:
    53
    Location:
    Montreal
    Today, no further ahead, I created two files in /wiki: /wiki/test.php and /wiki/test.html. They both contain simply one word: Hello.

    The HTML file loads fine in the browser. The PHP file doesn't load showing simply "No input file specified."

    Apache2 error log always shows:
    Code:
    AH01071: Got error 'Unable to open primary script: //home/user/public_html/wiki_2/test.php (No such file or directory)\n'
    Permissions on the file are correct:
    Code:
    # ls -l wiki_2/test.php
    -rw-r--r-- 1 ogall ogall 6 Apr 25 12:40 wiki_2/test.php
    The rest of the site works fine, just the wiki with this alias isn't working. Not sure what else to check. :(
     
  4. cPJacob

    cPJacob cPanel Product Owner
    Staff Member

    Joined:
    May 2, 2014
    Messages:
    599
    Likes Received:
    90
    Trophy Points:
    103
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Howdy,

    I think this is going to need an adjustment to the FPM config line inside httpd.conf. I want to say that it redirects to the DOCROOT, and Apache won't redirect those with FPM as it'll hand off the request to FPM before it reaches the redirect.

    Code:
    <FilesMatch \.(phtml|php[0-9]*)$>
    SetHandler proxy:unix:/opt/cpanel/ea-php55/root/usr/var/run/php-fpm/90982df21aa4c9ac9ef6af041aac95218072595c.sock|fcgi://domain.com/
    </FilesMatch>

    I think this'll need to be adjusted.
     
  5. outofcontrol

    outofcontrol Member

    Joined:
    May 18, 2009
    Messages:
    22
    Likes Received:
    1
    Trophy Points:
    53
    Location:
    Montreal
    Ugh, okay then. I've installed suPHP and set that site to not use php-fpm. Problem solved.
     
Loading...

Share This Page