How can I view the PHP error log?

For example if this instruction fails I want to see the message in the log:

if (!($socket = fsockopen($smtp_host, $smtp_port, $errno, $errstr, 15)))
error('Could not connect to smtp host "'.$forum_config['o_smtp_host'].'" ('.$errno.') ('.$errstr.').', __FILE__, __LINE__);

By the way does gear host allow me to connect to a remote SMTP using sockets from PHP?
What I am trying to do is to connect to my sendgrind account.

Actually this code succeeded I was able to send the email to sendgrid.
But I still need response on how to view PHP errors. How are you supposed to debug a program if you cannot view the log.
I went to LogFiles in my root and there is only a kudu subfolder, no PHP logs

Hello @jake,

We recommend enable PHP debugging through your .user.ini. The following article shows you how to create one here and we recommend adding the following code in user.ini:

error_reporting = E_ALL & ~E_DEPRECATED
display_errors = On
display_startup_errors = On

After that’s done, restart your CloudSite and it should display more verbose errors.