Comments (16)
Ehh, what a mess. Here is a possible hack:
<IfModule mod_php5.c>
// Set doPhp = 1
</IfModule>
<IfModule mod_php7.c>
// Set doPhp = 1
</IfModule>
<If doPhp>
// php flags here
</If>
I don't know the exact syntax to use offhand though, perhaps SetEnv.
from magento-lts.
Yup. I came across this earlier, although it's only supported with apache 2.4. Can we drop support for older versions of apache?
<IfModule mod_php5.c>
Define PHP_IS_ENABLED
</IfModule>
<IfModule mod_php7.c>
Define PHP_IS_ENABLED
</IfModule>
<IfDefine PHP_IS_ENABLED>
</IfDefine>
Otherwise I'm just inclined to add a comment to the htaccess noting about PHP7, but I did have a few hours of wondering why my PHP's max memory wasn't being read before I realized the php5 bit. Fixing this would definitely help out people down the line.
from magento-lts.
I would prefer to just remove <IfModule mod_php5.c>
instead of duplicate. If PHP isn't present then you've got major problems and probably don't want your webserver starting anyway and AFAIK all mod_php5 directives are compatible with all mod_php7 directives.
from magento-lts.
Removing the <IfModule mod_php5.c>
may cause issues with apache+fastcgi. I don't use fastcgi myself so I can't say for certain, but from what I've read using php_value in .htaccess without mod_php causes a 500 error. See http://stackoverflow.com/questions/4117572/using-htaccess-with-fastcgi#4118492
from magento-lts.
@jtnw Any thoughts on this? Or has this been solved?
from magento-lts.
@seansan for me, I just changed php5 to php7 in htaccess, haven’t touched it in the past year.
Apache 2.4 came out in 2012, so the Define directive should be widely supported. I would recommend we use the structure in my previous comment.
from magento-lts.
from magento-lts.
Sure thing, let me just do a quick test to make sure that the directive works.
from magento-lts.
actually, Apache is kind of recommending to stop using mod_php https://wiki.apache.org/httpd/php and instead use the fcgi solutions.
Besides, everybody should get used to set php settings via the php.ini
from magento-lts.
Also, it seems that the Define
directive cannot be used in .htaccess
. I am trying this solution as well, but it doesn't seem to work for me: https://stackoverflow.com/a/49031283
Edit: so basically it means the Define
solution would mean the user would have to edit the httpd.conf file to set the define which is much more confusing for a user.
from magento-lts.
I think the only solution right now is to duplicate the directives and put a comment in htaccess explaining it. Seems like mod_php shouldn't be used, but many people will keep using it and those htaccess settings for php are important. If there's another way I'm all ears though.
from magento-lts.
with mod_php you can use a php.ini like with php-fpm and php-cli
Every non-apache user is already doing this, and you need to put most of this settings anyway also for cli.
regarding the settings.
setting | .htaccess | php default | comment |
---|---|---|---|
memory_limit | 256M | 128M | is actually set higher in most environments I know |
max_execution_time | 18000 | 30 | thats 5hours!!!, for cli it should be unlimited, for webserver this is cazy high |
magic_quotes_gpc | off | off | |
session.auto_start | off | off | |
suhosin.session.cryptua | off | off | |
zend.ze1_compatibility_mode | off | off |
from magento-lts.
@Flyingmana does the custom php.ini file require editing vhosts/httpd.conf though? Some users won't be able to edit those files if they're on shared hosting of any sort.
from magento-lts.
@jtnw I would refer to the documentation/faq/support of the shared hosting then. Also shared hostings likely would not allow to change memory_limit or max_execution_time in any way.
If people notice specific problems with the Environment, they would need to know where to change this settings anyway. And for people not used to apache, it could be confusing to change a setting, and wonder why it is overwritten somewhere else.
from magento-lts.
@Flyingmana good points, my only other reservation on making users edit httpd.conf is that it's a departure from the upstream installation process where users just have to extract to htdocs. However if there's a much better solution than my PR above which was just a quick fix, we should take it.
from magento-lts.
Closed by #1001
from magento-lts.
Related Issues (20)
- Quote product prices rounding issues when catalog prices include taxes
- Upload gif image on backend system Configuration Issue HOT 2
- support smtp servers out of the box HOT 12
- In backend, add "click to copy text" feature HOT 1
- SOAP fault due to "SOAP-ERROR: Parsing Schema: can't import schema from 'http://schemas.xmlsoap.org/soap/encoding/' " HOT 25
- SOAP API: SOAP-ERROR: Parsing Schema: unexpected <complextype> in schema HOT 4
- Shopping Cart Price rule - Free Shipping weight condition
- feature request: Event for configuration actions (save/delete) on path HOT 2
- Admin filters and sorting not working after upgrader to v20.6.0 and v20.7.0 HOT 1
- Edit attributes broken? HOT 4
- Black background of PNG images with transparent background in the Wysiwyg editor HOT 11
- Skipped Zend_Validate_Barcode_Intelligentmail from autoloading HOT 1
- Improving the file name generation logic for JS and CSS files HOT 7
- After upgrade to v20.7.0 I got some alert on Admin Login HOT 16
- Fatal error after upgrading from 20.1.1 to 20.8 when clearing cache from Admin Page HOT 2
- Error when saving product with image without description HOT 6
- Problem with Configurable Swatches after PR #3686 HOT 1
- Unable to Override GroupController in OpenMage HOT 2
- N98-magerun tests fails since #2993 HOT 2
- Current category cache issue in navigation block
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magento-lts.