I am working on the contact form for the website. This contact form is realised through PHP. I was able to configure my local environment for this to work, but after deploying to production the functionality is gone.
From my point of view, the main reason why it is not working in production is that php.ini
does not have the same configuration as on my local machine. Here appears couple issues:
php.ini
on the server. php.ini
would probably break something, which would be very bad.The information I was able to find:
PHP 5.4.45 running as FastCGI application
Also one of my findings was (no surprise) to start using third-party solution like Mailgun or Mandrill. Mandrill is now plugin for Mailchimp what could be very useful as I already use Mailchimp for this project. But I do not want to go third-party as the project has a server and only missing a proper config.
UPDATE:
Thanks to the answer from @oleg_neumyvakin I have found that indirect per-domain modification can be done via .user.ini
configuration or if I had access to Plesk via Additional Configuration Directives
field. Although the sendmail_path
directive is not available for .user.ini as it can be only modified in PHP_INI_SYSTEM
- global php.ini
.
My question still remains open:
php.ini
configuration explicitly per domain (via .user.ini
) on the IIS 8.5? "SMTP", "smtp_port" and "sendmail_from" - are OK to be per-domain, but "sendmail_path" allowed for PHP_INI_SYSTEM only: http://php.net/manual/en/ini.list.php
You can set them via
/httpdocs/.user.ini file with content like:
[PHP]
display_errors=on
error_reporting=32759
log_errors=off
max_execution_time=120
max_input_time=90
memory_limit=64M
open_basedir="C:\Inetpub\vhosts\example.tld\httpdocs\;C:\Windows\Temp\"
post_max_size=16M
short_open_tag=off
upload_max_filesize=16M
error_log="C:\Inetpub\vhosts\example.tld\logs\php_errors\example.tld\php_error.log"
Plesk UI at domain's PHP settings > :
And add necessary settings to additional directives:
How to make sure that these changes do not affect the global PHP settings?
First of all you can set some directives to one domain and check phpinfo() for another domain. All custom PHP directives are per-directory settings and you can find them in Windows registry:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With