0

I followed this video to configure localhost in my Mac OS X El Capitan.

I have modified /etc/apache2/httpd.conf (eg, made /Users/softtimur as DocumentRoot and Directory), /etc/apache2/users/softtimur.conf and created /etc/php.ini.

Now if I write a simple /Users/softtimur/Home.html, I could load it in a browser by localhost/Home.html; loading phpinfo() in a PHP file does show the PHP configuration page in a browser.

However, in a terminal the result of apachectl -S is NOT Virtual Host configuration: Syntax OK as the video shows:

:Site $ apachectl -S
VirtualHost configuration:
*:443                  is a NameVirtualHost
         default server localhost (/private/etc/apache2/extra/httpd-vhosts.conf:40)
         port 443 namevhost localhost (/private/etc/apache2/extra/httpd-vhosts.conf:40)
         port 443 namevhost www.example.com (/private/etc/apache2/extra/httpd-ssl.conf:121)
ServerRoot: "/usr"
Main DocumentRoot: "/Users/softtimur"
Main ErrorLog: "/private/var/log/apache2/error_log"
Mutex proxy-balancer-shm: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/private/var/run/" mechanism=default 
Mutex mpm-accept: using_defaults
PidFile: "/private/var/run/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="softtimur" id=501 not_used
Group: name="_www" id=70 not_used

Does anyone know if there is anything wrong?

To set sendmail_path, I have followed this thread: 1) created a folder to store the email: /home/softtimur/Documents/TestEmails; 2) gave permission to apache: run sudo chgrp -R _www TestEmails from the Documents folder 3) modified php.ini: sendmail_path ='cat > /home/softtimur/Documents/TestEmails/mail.txt'

And then, I wrote a file testmail.php:

<?php
mail('mymail@gmail.com', 'the subject', 'the body');
?>

But loading the page did not send me any mail.

Does anyone know what's wrong in the whole process?

Community
  • 1
  • 1
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
  • I do not recommend using the mail function. I suggest using something like pear or phpmailer. – Teddy Codes Aug 02 '16 at 23:49
  • On El Capitan run `apachectl configtest` to check config syntax. Using `cat` in `sendmail_path` will not send any email, it is just for testing, see quoted thread. – baf Aug 03 '16 at 20:15

0 Answers0