Category Archives: Server

Useful SSH commands for access issues and Keys

Load custom php.ini with CRON job

Live and learn. I didn’t realize that when a cron job runs, it does not load the site php.ini file, but by adding a custom directive, we can tell the the php cron job to load the file. The error I was receiving is below even though I had allow_url_fopen enabled:
Warning: simplexml_load_file(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/username/script.php on line 12
Adding the custom directive resolved the issue and hopefully will for you too.

How to duplicate | copy a Magento Database with SSH

I was a bit hopeful with phpMyAdmin “Synchronize”, but Magento’s databases are apparently too big for it because I ended up with white screens and partial uploads.  I resorted to using SSH and doing it over command line.  Two lines of code and you can export from your live database and import into a production database.  Here you go. Export   Import Hopefully saved you some time and frustration 🙂

Couple of useful Powershell commands

Write all contents of folder to a .txt file.  Helpful if you have a folder of images and need a .txt list Recursive find query.  Super helpful to find code snippets within a local project  

Suspicious process running under user

I was tired of getting WHM email for processes that I was very much aware that were running.  You can add these to the ignore file to relieve the excessive emails.  Mine happened to be a php program so the syntax is as follows.  Open up the file and add: then you just need to restart the service for your changes to take effect.