You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by khodadadeh <kh...@hotmail.com> on 2016/08/29 12:18:51 UTC

[users@httpd] Apache 2.4 with PHP-FPM

I have installed PHP-FPM 5.6  and Apache 2.4 with mod_proxy and 
mod_proxy_fcgi.
I have two web sites on my server. One Magento and the other one that is 
written using Laravel framework.

Magento has URLs like: http://domain.com/index.php/ACP/
index.php exists in document root.

Laravel has URLs like: http://example.com/help.php
help.php does NOT exist in document root. It will be rewritten to 
index.php (using mod_rewrite).

Currently I have this directive to connect to my PHP installation:

ProxyPassMatch "^/(.*.php(/.*)?)$" 
"unix:/var/run/php-fpm/php5-username.sock|fcgi://localhost/home/username/public_html"

This works fine for Magento but when I browse Laravel URL(a non-existing 
URL with .php in it), it shows me "File not found" message.

If I switch to mod_rewrite  instead of mod_proxy_fcgi, I'll have laravel 
URl working but not Magento:

RewriteCond %{REQUEST_URI} "^/(.*.php(/.*)?)$"
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}  -f
RewriteRule ^(.*)$ 
"unix:/var/run/php-fpm/php5-username.sock|fcgi://localhost/home/username/public_html/$1" 
[P]



Is there any solution that I can use that ensures rewrite rules will be 
working and PATH_INFO is set?



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.4 with PHP-FPM

Posted by le...@lsces.co.uk.
If you can distinguish which url's need to use rewrite, and which do not, then extend the rewrite to only change the right ones. But I suspect that this is not possible, so you need some other way to identify which use each rule.

Sent from my android device so quoting is crap ... need to kill these painful email clients!

Re: [users@httpd] Apache 2.4 with PHP-FPM

Posted by le...@lsces.co.uk.
You will need to create two virtual hosts. Otherwise apache does not know whi h rules to apply. vh1/... with direct access and vh2/... with the redirect. Then your sites are just prefixed by vh1 or 2

Sent from my android device so quoting is crap ... need to kill these painful email clients!

-----Original Message-----
From: khodadadeh <kh...@hotmail.com>
To: users@httpd.apache.org
Sent: Mon, 29 Aug 2016 13:18
Subject: [users@httpd] Apache 2.4 with PHP-FPM

I have installed PHP-FPM 5.6  and Apache 2.4 with mod_proxy and 
mod_proxy_fcgi.
I have two web sites on my server. One Magento and the other one that is 
written using Laravel framework.

Magento has URLs like: http://domain.com/index.php/ACP/
index.php exists in document root.

Laravel has URLs like: http://example.com/help.php
help.php does NOT exist in document root. It will be rewritten to 
index.php (using mod_rewrite).

Currently I have this directive to connect to my PHP installation:

ProxyPassMatch "^/(.*.php(/.*)?)$" 
"unix:/var/run/php-fpm/php5-username.sock|fcgi://localhost/home/username/public_html"

This works fine for Magento but when I browse Laravel URL(a non-existing 
URL with .php in it), it shows me "File not found" message.

If I switch to mod_rewrite  instead of mod_proxy_fcgi, I'll have laravel 
URl working but not Magento:

RewriteCond %{REQUEST_URI} "^/(.*.php(/.*)?)$"
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}  -f
RewriteRule ^(.*)$ 
"unix:/var/run/php-fpm/php5-username.sock|fcgi://localhost/home/username/public_html/$1" 
[P]



Is there any solution that I can use that ensures rewrite rules will be 
working and PATH_INFO is set?



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org