You are not logged in.
Hi!
I just started to run an apache server, with php, and mysql (mariadb), it works great, however the script I used to install a preconfigured blog (SPIP) is warning me about two thing : First the the function date() is not safe and it should be use with a timezone. So I wonder howcan I make php interpret date() function in php code to another function that is safer.
Second thing, I cant use the option mail(), i tryed installing POSTFIX following the wiki but i get stuck. How can I activated the mail function ?
Last edited by maxarsys (2013-11-08 07:36:21)
Offline
Hi!First the the function date() is not safe and it should be use with a timezone. So I wonder howcan I make php interpret date() function in php code to another function that is safer.
date_default_timezone_set or edit php.ini.
Offline
Thanks, it solved it.
Now I decided to install ssmtp to be use for mail() command from php.
I configured everything works properly besides the fact that after I ve used a small script to test the mail() option, it doesnt work.
I get this error in /var/log/httpd/error_log :
sendmail: Cannot open mail:25
I ve read in the wiki that it is due because i have to add the user to the mail group.
Infact I did add root to mail group, and the command :
#mail myacc@gmail.com < testmail.txt
works great(when it was showing the same error"sendmail: Cannot open mail:25" when user root wasnt in mail group.
Now I added http, mysql, php to mail group using the command :
#gpasswd -a username mail
but i still get the error in /var/log/httpd/error_log.
Any suggestions ?
Fixed : I dont how but I was abble abble to send email in the console without the line :
mailhub=smtp.gmail.com:587
in my ssmtp config file and now i can send email with php, I had to add this in php.ini
sendmail_path = /usr/sbin/ssmtp -t
Last edited by maxarsys (2013-11-08 07:35:36)
Offline