Strange behaviour – it just stopped working 10 days ago and after a long search found a solution in specifying additional parameters in SSL connection, so working example should be like this:
$mail = new PHPMailer();
$mail->SMTPDebug = 2;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->SMTPOptions = array
'ssl' => array
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->Username = GOOGLE_SMTP_USERNAME;
$mail->Password = GOOGLE_SMTP_PASSWORD;
$mail->Subject = "Test";
$mail->Body = "hello";
echo "Mailer Error: " . $mail->ErrorInfo;
echo "Message has been sent";
catch (phpmailerException $e)
$errors = $e->errorMessage();
catch (Exception $e)
$errors = $e->getMessage();
You probably accidentally deleted some important files more then once. It is especially sensitive when it comes to photos from your family trip and when you deleting by instinct with SHIFT+Delete (avoiding Recycle Bin). I did that today and I needed some simple data recovery software. I remembered that there is File Scavenger who can restore accidentally deleted files and I installed it. Scanned the drive, found my photos and when I wanted to recover them I found out that I need to buy the licence for 55$. I didn’t like that so I decided to find free solution and found Recuva, free alternative for the same job. You don’t need commercial version and free version is just fine. It does the job perfectly!
I sometimes really hate Windows. When you do obligatory updates sometimes it takes hours for operating system to settle down and stop using CPU and memory like crazy.
One of these processes are mscorsvw.exe and ngen.exe which do some .NET assemblies optimization. I read about a lot of angry posts about these processes and that it takes hours “to optimize” and during these hours your server and services on it are suffering (and you need to be clever when finding explanations to your clients).
Follow these steps:
- Navigate to the following location in Windows Explorer: C:\Windows\Microsoft.NET\Framework\v4.0.30319
- Run an elevated command prompt and change the current directory to the following directory
- Type ngen.exe executequeueditems, and press ENTER
- Wait until you receive the following message at the command prompt: All compilation targets are up to date.
This annoying processes stopped but now TiWorker.exe is taking his time and eating the CPU and Memory and it looks like it will take 3-4 hours. Yikes! I really hate Windows programmers for this hidden background CPU and Memory eaters.
I faced today strange problem that I could not connect to Windows server through Remote Desktop Connection. When I click “Connect” it disconnect me immediately. Restarting the server didn’t helped.
Here is the simple trick how you can connect…
- Open RDC dialog and click on Show Options
- Go to Advanced tab and choose under If server authentication fails option Connect and don’t warn me
- You are now successfully connected after pressing the Connect button
Glad to hear if this saved you day. You can Tweet this solution so help someone else.
There are a lot of system stuff that just eat important space in Windows on disk C (if you have SSD and smaller C partition you don’t want to run out of space).
The best way is to create a junction (symbolic link) and to move some big folder to another partition (you need to have one first).
By doing this Windows will be fooled because you will get the same path but it will be shortcut (pointer) to another real location.
To do this move completely chosen folder to another partition and create symbolic link like this:
mklink /j c:\windows\MyMovedFolder d:\MyMovedStuff\MyMovedFolde
Sometimes you want to create folder alias for your website like this: /images to be mapped to /home/your_account/public_html/images.
To do this, you need to edit Apache httpd.conf file which is located at /etc/httpd/conf
It is clever to put all aliases in one file in the same directory and name them aliases.conf and then only to reference this file from httpd.conf.
You will include aliases.conf in httpd.conf like this:
You define alias in aliases.conf file like this:
Alias /images /home/your_account/public_html/images
Options Indexes FollowSymLinks ExecCGI Includes
Allow from all
- Copy original (default) CPanel php.ini file from location: /usr/local/lib/php.ini to your account folder: /home/account_username/path_to_php_ini/
- Add the following code to the .htaccess file within your account’s public_html folder: suPHP_ConfigPath /home/account_username/path_to_php_ini/
- Change this php.ini file to suits your needs and That’s all folks!
replace everywhere ‘/home/account_username/path_to_php_ini/‘ with the appropriate path to your custom php.ini file)
I have lost 6 hours of my time when I was trying to add new MultiSAN SSL on server. We already used one and we just added one new SAN placeholder for one subdomain.
Server: CentOS Linux + CPanel
- Entered new SAN, using saved CSR and Re-issued the SSL certificate
- Went to https://panel.mydomain.com > SSL/TLS Manager and added the new SSL under SSL/TLS Manager > Certificates (CRT) > Generate, view, upload, or delete SSL certificates.
- Nothing helped because when I visited https://subdomain.mydomain.com it said that it is using old SSL certificate which has expired.
- Tried everything, Re-keying, generating new CSR, few times downloading newly prepared SSL certificate, editing Apache httpd.conf file but nothing help.
- After 6 hours I saw the last option: SSL/TLS Manager > Install and Manage SSL for your site (HTTPS) > Manage SSL sites. Uploaded there all three things:
- My SSL certificate
- Decoded private key
- My provider’s SSL certificate
- Restart Apache web server
Voila! It finally worked!
What unfriendly user interface where all 4 options are equal and it is not obvious what needs to be done. Or maybe, I am the exception. Tried 3rd option all the time.
Hate these things, but on the other side I learned something new and you will spare some time if you come to the similar problem. Hope, you will find this post quickly!
I definitely wrote this post also for myself, it was not the first time I was searching for some solution and Google listed me my blog post 🙂
I faced once strange problem that somehow system environment variable %windir% could not be resolved.
This means that all shortcuts that are pointing to C:\Windows\System32 will not work.
You will not be able to set it directly by clicking with right mouse button on Computer icon and you will get this message
To solve this just open this directly from Start > Run… and set this environment variable
In my case %windir% was pointing to undefined %SystemRoot% so I just added it and make it point to C:\Windows
This didn’t helped. After the research I found out that length of my %PATH% variable was more then 2048 chars.
It must be bellow 2048 chars and when I deleted non-important paths it started working OK!
Keep your system variables less then 204 chars in length!