• Home
  • About Me
  • Resume
  • Useful Links
  • Português
  • Contact

EmanuelCosta.com

E-Commerce, SEO/SEM/Online Marketing, Web Development, Usability, WordPress & WooCommerce

  • LinkedIn
  • Twitter
Home » Archives for November 2015

Archives for November 2015

cPanel on AWS EC2 using Amazon Linux w/ Yours Nameservers

Posted on November 24, 2015 Written by EmanWeb

Today I finally could spin off a server running cPanel on Amazon Web Services. You can find great instructions here: How to Setup cPanel on AWS

and here also very important if you want to run your own nameservers: Amazon EC2 Nameservers on AWS

But if you plan on using Amazon’s own Linux flavor, make sure you  do this two steps before installing cPanel:

  1. Remove dovecot from your yum.conf file excluded list;
  2. Run the following command to install all the required libraries.
yum install xz-compat-libs-5.1.2-8alpha.11.amzn1.x86_64

That will make sure you have the latest required RPM packages to run cPanel on Amazon Linux.

If you don’t run these steps above, you may get this error:

 - ssystem [BEGIN]: /scripts/rdate
open3: exec of /scripts/rdate failed at /home/cPanelInstall/selfgz23309/install line 238.
Removing /root/installer.lock.

or this one:

liblzma.so.0()(64bit) is needed by dovecot-1:2.2.19-1.cp1148.x86_64

Before running the command to install cPanel, make sure your hostname is a public accessible, something like: ec2-IPADDRESS.us-west-2.compute.amazonaws.com

After all that everything runs fine and you just need to finish setting up your cPanel/WHM installation.

11-24-2015 5-59-50 PM

 

Do you run cPanel on AWS? Let me know how does that work for you.

 

Update 1: I had to edit the named.conf file to allow queries since we are running our own nameservers. Make sure you check the line for:

allow-query { any; }; 

Update 2: Once cPanel is running you should really optimize it’s settings for your server. I found this link very informative:

Optimize MySQL & Apache on cPanel/WHM server

Make sure also you follow the firewall/security settings mentioned there.

  • delicious Bookmark on Delicious
  • digg Digg this post
  • facebook Recommend on Facebook
  • linkedin Share on Linkedin
  • reddit share via Reddit
  • stumble Share with Stumblers
  • twitter Tweet about it
  • rss Subscribe to the comments on this post
  • print Print for later
  • email Tell a friend

Filed Under: Linux Tagged With: cpanel, hosting, linux

PHPStorm, WordPress and Debug

Posted on November 18, 2015 Written by EmanWeb

Yesterday I had a bug to fix that once I did, realized I should give PHPStorm its credits. Here’s the scenario:

  • I wrote a plugin that runs a query every hour to get GravityForms leads, convert to CSV file and post to remote FTP server;
  • There was no error message or any indication that there was a problem in the code (see pic 1), even with WP_DEBUG set to true, when manually running the scheduled task.
pic 1
pic 1
  • The only information I had was that the query did have records that were not outputting to the CSV file.

Debug WordPress Cron Tasks

So, how to debug if there’s no error message? Well, here are the steps:

    1. Make sure to disable all the scheduled tasks. On your wp-config.php file add:
      //This will allow to run the task you want to debug individually. 
      define('DISABLE_WP_CRON',true);
    2. I use this great plugin to see the WP Cron events, it allows you create your own schedules and run them individually (as in the pic 1), named WP CONTROL 
    3. Then, using WP Control, edit the event you want to debug and set to a time in the past (pic 2).

      11-18-2015 3-08-27 PM
      PIC 2 – Edit Cron Event Using WP Control
    4. Now, with WP_DEBUG set to true, go to this URL: http://yoursite/wp-cron.php?doing_wp_cron
      You then can see the error message. Like the one below:

      11-18-2015 1-19-43 PM
      PIC 3
    5. Now, how to find the problem in the code? Well, the orange line in the pic 3 above shows exactly where the problem is.

Solving the Problem With PHPStorm

PHPStorm is a poweful IDE for writing PHP code. I was introduced to it early this year at WordCamp Orange County’s presentation from Joe Chellman  on debug WordPress for real. (I tried to find the video but seem not available).  Here’s his presentation slides: http://www.shooflydesign.org/files/wcoc-2015/#/

So, after I setup PHPStorm to debug my web application (I plan on posting about this sometime soon), set some breakpoints in my code, here are some screenshots that make me think PHPStorm is worth every penny (It costs under $100/personal license).

11-18-2015 1-15-43 PM
Note the inline debug information in the code and the bottom 3 panels with variables and specially the one on the right, where I “watch” a variable.

 

PHPStorm also allows you get information right in the code panel. See example below:

11-18-2015 1-21-00 PM

And there’s more 🙂 You can setup dynamic breakpoints so they will only fire if the condition is met:

11-18-2015 1-22-35 PM

This new method to debug have saved me tons of time fixing issues like this one. But not only that, it allows you also step line by line on others peoples code and see what’s going on under the hood. If you develop in PHP, I strong recommend taking a look at PHPStorm.

Do you use other IDE? Are you already using PHPStorm? Did you have a hard time setting up WordPress Xdebug on your development enviromment? Let me know your comments and experiences.

  • delicious Bookmark on Delicious
  • digg Digg this post
  • facebook Recommend on Facebook
  • linkedin Share on Linkedin
  • reddit share via Reddit
  • stumble Share with Stumblers
  • twitter Tweet about it
  • rss Subscribe to the comments on this post
  • print Print for later
  • email Tell a friend

Filed Under: PHP, WordPress Tagged With: Debug, PHP, PHPStorm, Schedule Tasks, WP-Cron

WordPress Developer? Really?

Posted on November 15, 2015 Written by EmanWeb

I’ve been building and developing websites for over 20 years now. I’ve lost count of how many sites I have done. My guess? Over one thousand…. Sites of all sizes, shapes, goals, running on Windows or Linux. I’ve hand wrote code (and still do, I am in love with PhpStorm), I’ve used lots of different tools, all type of software programs and technologies. I once did an entire shopping cart in Flash. I know, I am guilt as charged. But that was 2002! I also wrote from scratch the code and database for a whole eCommerce site that sell custom wheels and tires. 

WordPress-for-iOSSince 2010, I’ve being using WordPress, a lot! When I tell my friends, that are either in the IT industry or not, that I am WP enthusiast now, I see two distinct reactions. I will focus on the group (clients, non tech savvy people) that are either frustrated and/or have misconception about this powerful CMS (Content Management System).

There is one main reason this group have a wrong opinion about WordPress: People that actually call themselves developers, WordPress Developers, when in fact they are not.  Mario Peshev explains this situation very well on his blog:

Don’t Call Yourself a Developer If You Don’t Code

The “major problem” as he stated and I agree 100%, is the fact that WordPress super users, designers, “integrators”, installers, are calling themselves Developers when in fact they are not! Since the human nature, on many people, is to blame others first instead of assuming theirs own responsibilities and/or lack of knowledge, I see very often in the Website Development industry, these professionals blaming the “tool” or programming language, database, web server, in this case, WordPress, for the issues they have/had using it for clients.

So, I usually also compare WordPress with a racing car (the other comparison is WordPress with Jiu Jitsu). An amateur driver, could drive it, can even speed up and give the impression that he’s fast. Reality is that a professional car racing driver, not only can go fast and take the most from the vehicle, but also understands its mechanics, physics, materials and see potential issues before they actually happen. To be a real WordPress developer, it requires to already know PHP, MySQL, jQuery, CSS, etc and  lots of time to learn WordPress development and to do things the right way.

WordPress now runs on 25% of all Websites and has 58% of the CMS market. This number could have been even more, if wasn’t for the major problem above. So, please if you do Websites with WordPress, make sure you define yourself right. Everyone will benefit from that.

What’s your opinion? Are you frustrated with WordPress or your “Developer”? Do you have good experiences? Let me know.

  • delicious Bookmark on Delicious
  • digg Digg this post
  • facebook Recommend on Facebook
  • linkedin Share on Linkedin
  • reddit share via Reddit
  • stumble Share with Stumblers
  • twitter Tweet about it
  • rss Subscribe to the comments on this post
  • print Print for later
  • email Tell a friend

Filed Under: Web Development, WordPress Tagged With: cms, developer

Find Here

About me

Hello, my name is Emanuel Costa. I build professional websites and help companies grow online. I write this blog to help myself about what I learned and perhaps help other people. I help organize meetups and whenever I can I attend tech events, specially WordCamps. Read more about me. (p.s.: Agora escrevo um blog em Português aqui: emanweb.com.br

Latest WordCamp:

WordCamps I Attended:

I am volunteering at WordCamp Las Vegas 2019″ title=

WordCamp Fortaleza

I'm attending WordCamp San Diego

I am Attending WordCamp Miami 2016


WordCamp US

Categories

  • ActionScript
  • Blogs
  • ColdFusion
  • CSS
  • Experience
  • Flex and Flash
  • Gadgets
  • Google
  • JavaScript
  • Linux
  • MySQL
  • PHP
  • SEO
  • SEO and Internet Marketing
  • SQL Server and T-SQL
  • Uncategorized
  • video
  • Web Development
  • WooCommerce
  • wordcamp
  • WordPress
November 2015
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Sep   Dec »

Recent Comments

  • Peter Crouch on How to output a list of IDs in a field as recordsets / Como retornar uma lista de IDs como recordset
  • Simon on cPanel on AWS EC2 using Amazon Linux w/ Yours Nameservers
  • WordPress Developer? Really? - EmanuelCosta.com on Gracie Brazilian Jiu Jitsu and WordPress. What these two have in common?

Follow Me

  • Linkedin
  • Meetup
  • RSS feed
  • @emanweb

Navigation

  • Home
  • About Me
  • Resume
  • Useful Links
  • Português
  • Contact

Need quick tech advice? Pick my brain:

Copyright © 2025 · Focus Pro Theme on Genesis Framework · WordPress · Log in

 

Loading Comments...