- How is php.ini related to php.ini-development and php.ini-production?
- How is php.ini related to php.ini-development and php.ini-production?
- Using php.ini-production and php.ini-development -> php.ini breaks Kubernetes env vars
- How to manage different php.ini settings in production and development?
- PHP Error Reporting Production vs Development
- Форум
- Re: php.ini-development или php.ini-production
- Re: php.ini-development или php.ini-production
- Re: php.ini-development или php.ini-production
- Re: php.ini-development или php.ini-production
How is php.ini related to php.ini-development and php.ini-production?
Thoughts or ideas i’ve had which i dont know if they are feasible: php.ini includes — just include the dev settings at the end of the file? conditional loads from apache conf? write a script that when php.ini changes, a dynamic version of phpdev.ini gets generated — (i know this can be done) use runtime php settings for display errors — i think this has limitations because if the script has fatal errors, then it wont run the runtime setting. Development environment offers verbose messages and comfortable optional features, what you want when you’re coding your scripts.
How is php.ini related to php.ini-development and php.ini-production?
In the PHP installation, there is php.ini, php.ini-development, and php.ini-production. I understand that the settings in php.ini are the ones that should be changed, so what are the other two for?
They are template files for you to copy over to your actual php.ini if you feel it matches your environment’s needs.
- Development environment offers verbose messages and comfortable optional features, what you want when you’re coding your scripts.
- Production environment is typically more minimalist (i.e. errors are logged rather than displayed, etc), for interacting with real users efficiently.
Web — No php.ini file, In PHP 5.6 I couldn’t find a php.ini.recommended file. I found php.ini-production and php.ini-production and php.ini-development. I used one of those …
Using php.ini-production and php.ini-development -> php.ini breaks Kubernetes env vars
I was reading the documentation on Docker hub and came across the:
Configuration This image ships with the default php.ini-development and php.ini-production configuration files. It is strongly recommended to use the production config for images used in production environments! I followed the steps to use them by adding the following in my Dockerfile.dev :
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
Now when I start my cluster, all of the environmental variables it uses in the index.php say Undefined Index and the program no longer works. The fix is to comment out RUN mv. and then everything works again.
Why would it be breaking the Kubernetes environmental variables and how can I get them to work in conjunction?
Seems like switch from fetching environmental variables with $_ENV[»] to getenv(») fixed the issue.
Apache — Is there any option in php.ini to set whether this, There’s no such thing in php.ini*, but you can do that simply by setting an environment variable: SetEnv MYAPP_ENVIRONMENT production Put …
How to manage different php.ini settings in production and development?
Is there a best practice for managing php.ini configurations from development to production? Obviously it can be done manually, but that is prone to human error. I’d like to try and have the production file in version control and then possibly modify the development version automatically. Thoughts or ideas i’ve had which i dont know if they are feasible:
- php.ini includes — just include the dev settings at the end of the file?
- conditional loads from apache conf?
- write a script that when php.ini changes, a dynamic version of phpdev.ini gets generated — (i know this can be done)
- use runtime php settings for display errors — i think this has limitations because if the script has fatal errors, then it wont run the runtime setting.
- Backup Plan — keep the production version in SC, and manually change phpdev.ini as needed as needed. Then if manual mistakes are made they are done at the development level.
- Store your ini in your source code repository in different directories named after their environments: environments//php.ini
- On each environment, do this: rm /etc/php.ini; ln -s /var/www/site/environments/prod/php.ini /etc/php.ini
This way, you get the benefits of revision control and don’t necessarily have to edit each manually.
I don’t know exactly if this is what you’re looking for, but personally I like to perform all non-security-necessary php.ini modifications via the Apache VirtualHost settings, e.g. a development virtualhost:
ServerName sb.local ServerAlias sb.local DocumentRoot /srv/some-site php_value session.cookie_domain "sb.local" php_value date.timezone "America/New_York" php_value mbstring.func_overload 7 php_value default_charset "utf-8" AddDefaultCharset utf-8 php_value session.gc_maxlifetime "990000" php_value error_reporting 30711 # 30711 = E_ALL ^ E_NOTICE php_value display_errors "On" php_value display_startup_errors "On" php_value log_errors "On" php_value html_errors "On"
How do I create custom php.ini files for each virtual host?, Currently and out-of-the-box, the php.ini file is loaded from: C:\Program Files (x86)\EasyPHP-DevServer …
PHP Error Reporting Production vs Development
What is best practice when setting error reporting on development and production applications? At the moment I have the following:
// development error_reporting(E_ALL); // production ini_set('display_errors', 0); ini_set('log_errors', 1); error_reporting(E_ERROR | E_WARNING | E_PARSE);
Quoting the php-production.ini that should have come bundled with your PHP:
; PHP comes packaged with two INI files. One that is recommended to be used ; in production environments and one that is recommended to be used in ; development environments. ; php.ini-production contains settings which hold security, performance and ; best practices at its core. But please be aware, these settings may break ; compatibility with older or less security conscience applications. We ; recommending using the production ini in production and testing environments.
; display_errors ; Default Value: On ; Development Value: On ; Production Value: Off ; display_startup_errors ; Default Value: Off ; Development Value: On ; Production Value: Off ; error_reporting ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED ; Development Value: E_ALL ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT ; html_errors ; Default Value: On ; Development Value: On ; Production value: On ; log_errors ; Default Value: Off ; Development Value: On ; Production Value: On
Since you asked for best practise, I suggest you go with that.
For the best error logging experience, set error_reporting to -1 (absolutely everything), turn display_errors off , and set a custom error_log .
Then in the terminal, type tail -f /path/to/error_log . Your notices, warnings and errors will now scroll past in real time, without distorting your web page’s display.
It’s always worth logging everything. In any environment.
Development and production environment in PHP, One — to develop new versions and test them. And second production where my actual stable version of website will be available. Website in PHP will …
Форум
Доброго времени суток!
У меня возникли вопросы по редактированию php.ini файла в версиях php 5.3 и выше.
Существует php.ini, php.ini-development и php.ini-production (php 5.3). Насколько я понял php.ini создается при каждом запуске open server. Так какой же мне файл редактировать что бы добиться ожидаемого результата. Ко всему этому я не могу подключить модуль расширения php_pdo_mysql.dll для работы с базой данных. Я уже и указал полный путь в extension_dir к папке ext и расскаментил соответственныю струку в php.ini. Я редактирую не тот файл или проблема в другом. Спасибо
Re: php.ini-development или php.ini-production
Re: php.ini-development или php.ini-production
«Изучите меню программы и вы найдёте то, что вам нужно.» — Не поленился даже зарегистрироваться, настолько показался некорректным ответ. Если нечего по существу ответить, а может и знаний нет соответствующих , то лучше промолчать. Вот так новички и здуваются из-за подобных ответов.
OpenServer \ userdata \ config \
Re: php.ini-development или php.ini-production
Kernel Paniceev, когда кажется — крестится надо На самом деле всё просто — все конфиги есть в меню программы. Достаточно пошевелить пальцем.
DelphinPRO Сообщения: 850 Зарегистрирован: 01 фев 2012, 17:27 Откуда: Самара
Re: php.ini-development или php.ini-production
>> а может и знаний нет соответствующих
ага, блин, разработчик комплекса не знает где лежат конфиги
ну ладно, кину скриншот, для ленивых