Course Progress for C++ & WP

So far for C++, I have successfully churn through 1/3 of C++ Primer by Stanley B. Lippman in a month (It’s a really, really thick book. If it wasn’t softcover, you can probably knock someone out with it.). It is quite the intense reading – very detail but clear in its explanation. I can see why several Amazon reviews raved about it being an excellent book but emphasizes that it is not a beginner book (Seriously, do not read this if you have never touched OOP). Despite having skipped Intro to C++, I am doing fine in class as a result. I am so glad I am such a fast reading bookworm!

WordPress/Drupal have so much more assigned reading than any of my other programming classes! I literally read through 4 chapters of the textbook (Professional WordPress: Design and Development by Brad Williams, David Damstra, Hal Stern) in a week, plus 2 web pages in WordPress documentation about Core and Loop. I thought my brain was going to fried – who knows there is so much about WordPress? Core, content, admin, include, etc, etc.

Doing some extra self-challenge added some… challenge, to the class as well. I decided to run the whole LAMP stack natively when I got my new Macbook last year. I did had MAMP in my old Macbook, which was indeed a convenient program, but I was taking Linux when I got my new Mac and I was getting more and more interested in OS. Running my own LAMP, with all the troubleshooting and exploring sounded fun.

As a result, several error message came up with my second class assignment, and here is the notes about the problems I got to solved!


1) WordPress was asking for connection information when I try to update and upload the class’s assigned Underscore theme. At first, I just manually updated WP and upload the theme. Then I got asked again after trying to install plugin too, so I decided to look up for some better solution. After some research, I learned that I need to change WordPress’s filesystem method so it stops using FTP, so I added this in the wp-config.php:

/** Change filesystem method when localhost */
if ($_SERVER[‘REMOTE_ADDR’] == ‘127.0.0.1’||’::1′) {
define(‘FS_METHOD’, ‘direct’);
}

Just define(‘FS_METHOD’, ‘direct’) also works, but I thought I would add an if statement to check if the file is in localhost, I don’t have to worry about removing the line if I need to move the page from development to production mode.

Note that ‘127.0.0.1’ is the localhost ip for IPv4 system, while ‘::1’ is for IPv6. Including both allow the code to go into both system. For my Macbook, the code do not work if ‘::1’ is not included.

2) I got permission error, which was not fix by chmod 775 or 777. In that case, I thought it may be an chown issue instead of chmod. I looked up which user is localhost apache running as for in Mac OS, and the user turned out to be _www (MAMP users may have a different user). So I did chown -R _www wordpress. Now everything works.

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.