par
Reka » 26 janv. 2017, 16:52
Merci pour ta réponse rapide, Moogli.
Pour répondre à tes questions :
Mon php.ini comprend la ligne
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
(pas seulement E_ALL : bien ou pas?)
Display_error était mis à off, mais j'avais un ini_set('display_errors', 1); au sommet mon fichier php. Quoi qu'il en soit, j'ai remis le display_error à on en local dans le php.ini, ça me paraît plus prudent, ça m'évitera d'oublier un ini_set lors de la mise en prod de mon app.
Autoload : Je ne charge rien automatiquement depuis mon application, donc le
require me semble nécessaire ?
Si je le commente, j'obtiens l'erreur :
Fatal error: Uncaught Error: Class 'PHPMailer' not found in /var/www/html/app/question_add.php on line 106
( ! ) Error: Class 'PHPMailer' not found in /var/www/html/app/question_add.php on line 106
Pour ce qui est de la
configuration de sendmail, j'avoue ne pas avoir fait ça très souvent...
J'ai mis en application ce tuto :
http://lukepeters.me/blog/getting-the-p ... -on-ubuntu
- en vain -
pour php.ini, j'ai remplacé smtp = localhost par smtp = smtp.monhebergeur.com
- en vain -.
"Mais sans doute dois-je adapter la ligne liée à Unix comme je suis sous Linux", ai-je pensé...
Du coup j'ai adapté la ligne pour unix comme suit :
sendmail_path = "/usr/sbin/sendmail -t -i"
... en vain (= toujours pas de mail dans ma boîte de réception, spams y compris)
Voici la partie mail de mon fichier php.ini :
Code : Tout sélectionner
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; SMTP = smtp.infomaniak.com
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = [email protected]
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "/usr/sbin/sendmail -t -i"
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail().
;mail.force_extra_parameters =
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On
; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
; Log mail to syslog (Event Log on Windows).
;mail.log = syslog
Qu'en dites-vous ?
Ai-je oublié quelque chose ?

Merci pour ta réponse rapide, Moogli.
Pour répondre à tes questions :
Mon php.ini comprend la ligne
[b]error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT[/b]
(pas seulement E_ALL : bien ou pas?)
[b]Display_error [/b]était mis à off, mais j'avais un ini_set('display_errors', 1); au sommet mon fichier php. Quoi qu'il en soit, j'ai remis le display_error à on en local dans le php.ini, ça me paraît plus prudent, ça m'évitera d'oublier un ini_set lors de la mise en prod de mon app.
[b]Autoload[/b] : Je ne charge rien automatiquement depuis mon application, donc le [b]require[/b] me semble nécessaire ?
Si je le commente, j'obtiens l'erreur :
Fatal error: Uncaught Error: Class 'PHPMailer' not found in /var/www/html/app/question_add.php on line 106
( ! ) Error: Class 'PHPMailer' not found in /var/www/html/app/question_add.php on line 106
Pour ce qui est de la [b]configuration de sendmail[/b], j'avoue ne pas avoir fait ça très souvent...
J'ai mis en application ce tuto : http://lukepeters.me/blog/getting-the-php-mail-function-to-work-on-ubuntu
- en vain -
pour php.ini, j'ai remplacé smtp = localhost par smtp = smtp.monhebergeur.com
- en vain -.
"Mais sans doute dois-je adapter la ligne liée à Unix comme je suis sous Linux", ai-je pensé...
Du coup j'ai adapté la ligne pour unix comme suit :
sendmail_path = "/usr/sbin/sendmail -t -i"
... en vain (= toujours pas de mail dans ma boîte de réception, spams y compris)
Voici la partie mail de mon fichier php.ini :
[code]
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; SMTP = smtp.infomaniak.com
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from =
[email protected]; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "/usr/sbin/sendmail -t -i"
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail().
;mail.force_extra_parameters =
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On
; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
; Log mail to syslog (Event Log on Windows).
;mail.log = syslog[/code]
Qu'en dites-vous ?
Ai-je oublié quelque chose ? :|