Apache Alias directive not working un EA4 with PHP-FPM

outofcontrol

Member
May 18, 2009
24
1
53
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?
 

outofcontrol

Member
May 18, 2009
24
1
53
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.
 

outofcontrol

Member
May 18, 2009
24
1
53
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. :(
 

JacobPerkins

Well-Known Member
May 2, 2014
617
97
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.