Instead of installing a LAMP environment by installing the different components separately in Windows, there’s a simple one click install which works beautifully. Plus you can install PHP apps like WordPress, Drupal, Joomla using the same one click installs.
- Download and install XAMPP
- I am running IIS on my machine which uses port 80. Therefore Apache needs to be using a different port as you can’t have two web servers listening on the same port. Run C:\xampp\xampp-control.exe. Clicking the Start button for Apache will fail because Apache is trying to listen on port 80 which is already being used by IIS. Apache needs to use a different port. Click on the Config button and open the httpd.conf file. Change the line ‘Listen 80’ to ‘Listen 81’ or any available port. Save the file. We need to change the SSL port as well. Click the Config button and select the httpd-ssl.conf file. Change the line ‘Listen 443’ line to ‘Listen 444’ or another open port. Save the file. Now clicking the Start button for Apache will start it. If not, view the visible log for the error and fix accordingly.
- Click the Start button for MySQL. Now your LAMP environment is ready for use.
- Download and install apps like WordPress from Bitnabi. The installer is smart enough to install the app within XAMPP. No further configuration is necessary
- To bring up WordPress for example and if you followed the previous steps, open a browser and go to localhost:81/wordpress and WordPress should show up. Follow the instructions from there for first time use.
- Similarly if you installed Drupal and Joomla, you can use localhost:81/drupal or localhost:81/joomla
- I wrote the instruction above from memory. I hope I didn’t miss a step but it should be easy to follow the steps.
In my previous post I talked about how to view what SQL statements a PHP program sends to a MySQL database in real time. Coming from using Microsoft’s development tools (Visual Studio, .NET & SQL Server) to using PHP and MySQL, I feel Microsoft has made me a spoiled developer with the tools I have on hand. Tools that are very powerful, yet easy to use and require very little or no setups. I came across a tool which enables me to code and debug PHP in my favorite IDE, Visual Studio (VS).
PHP Tools for Visual Studio from Devsense. It’s a Visual Studio extension which enables you to code and debug PHP applications right from inside VS. It’s very easy to set up including the set up for xdebug for debugging. It even showed the recommended xdebug settings and offered to apply the changes to php.ini instead of me doing them manually. As a PHP beginner, I like that PHP documentation is available inside VS. When hovering over any PHP method, a tooltip shows me the function description. It’s a big time saver. I don’t have to open a PHP site or book to learn what function does. A basic version is free and a Pro version is $79. A 30 day trial is available which has all the Pro features. The Basic version doesn’t include debugging and other features. So for me the Basic version is of no use as the whole reason for me for using such a tool is for debugging. I just started evaluating the product yesterday and I am very impressed with the ease and quality of this software.
I am a full time .NET developer however I am working on a personal project which involves WordPress and converting a WordPress to .NET. That’s why I am learning PHP because I need to know how WordPress and the plugin work in PHP. More...
One application I find very useful is SQL Server Profiler which I often use for debugging Windows apps which connect to SQL Server. The profiler displays all the commands which were issued by the app. One of my personal projects I am working on is WordPress. WordPress uses PHP and MySQL for its database. WordPress interacts heavily with MySQL. I need to debug WordPress and find out it’s sending to MySQL? I need a tool like SQL Server Profiler. I did some research and was disappointed to find out there’s nothing as powerful and as easy to use as SQL Server Profiler. This is when I appreciate what Microsoft provides for its developers. I am a .NET developer and switching to PHP and MySQL is an less pleasant experience. I will blog about how to set up PHP debugging.
I tried different MySQL profilers or tracers, as some call them. I was getting annoyed by how clunky or how buggy or how time consuming these tools are to set up and use until I came across a tool which looked very promising, Neor Profile SQL. It’s a free proxy app which sits between your client (WordPress in my case) and MySQL. It receives and captures the SQL commands from the client and then passes them to MySQL. Then it receives the response and passes them back to the client.
Neor was very simple to set up. All I had to do is tell WordPress to talk to Neor instead of to MySQL and this is done by changing the port it uses from port 3306 (MySQL’s port) to Neor’s port 4040 (can be changed). In WordPress this is done by changing the port number in the wp-config.php. Neor needs to be running during debugging.
Don’t forget to change back the port number when you’re done. This is as close SQL Server Profiler experience as I could get. Real time SQL logging with some useful statistics.
(Screen1): This screen shows the sessions WordPress used to load my home page. The home page has an image slider which issues its own SQL commands.
(Screen 2): Then double clicking the first session, shows the queries in this screen capture. The SQL code of the selected query is shown.
Today I came across an error message from Excel 2013. I was trying to open an .xlxs file and received this error:
I have gigs of free memory (system has 32G RAM) and gigs of free disk space on my c drive and the drive which holds the temp folder. So I know this error message is misleading and the issue is most probably something total unrelated to this message.
After searching the web, the simple solution was to right-click on the file and click the unblock button. It seems Windows (I am using Windows 8) didn’t trust the file because it I downloaded it from the web.
This is a quick tip. If you experience too much jaggies or pixelation when scaling a bitmap image up or down, try Perfect Resize from OnOneSoftware. It comes either as a stand alone program or as a plugin for Photoshop and other graphics software. In some instances, it does a much better job than Photoshop’s resizing feature. The company offers a 30 day fully functional download.
I was researching some commercial Magento themes (templates) this week. Magento is a PHP based e-commerce (shopping cart) solution. My favorite site for providing templates is Themeforest. They have affordable high quality mostly web 2.0 style themes. The site itself is very clean, high quality, simple yet very usable. I sorted the Magento themes by number of sales. This usually means the first themes in the result listing are of polished high quality themes and that’s why they sell well. One statistic Themeforest provides for each theme is the number of sales. I looked at the first theme, Fortis and quickly determined the revenue:
Price $80 x # sold 1639 (as of now) = $131,120. Wow! That’s a lot of money from selling a single digital product. The template was added to Themeforest on March 6th, 2012. Not bad for less than a year display and more to come.
minus Themeforest’s average commission, say 35%, what’s left is $85,228 (rates schedule)
minus taxes, pure profit is at least $50,000.
What do I do to reward myself from a side job which put $50,000 in my pocket?
A brand new exciting Tesla model S car!
So if you want to make some extra money and you’re a good web designer, consider selling templates. Not just html templates but a full theme for a CMS or shopping cart or platform. These templates sell for more and have less competition.
In this post I will describe how to unbend those tiny hard to see pins on an LGA 2011 motherboard socket. I accidently pressed down a few pins on a LGA 2011 socket. When looking at all pins, I noticed a group of pins had a slightly different color from the rest of the pins. This is due to the different position of the pins and how they reflect light.I noticed this and but went ahead placing the CPU in the socket hoping everything would still go fine and the computer start up as normal. Sadly, this didn’t happen.
The computer kept rebooting every 10 seconds after startup. I figured this had to do with socket's pins being not in full contact with the contacts on the CPU. The pins on the sockets are very small and hard to see with the naked eye. I decided I needed a magnifier and a tool to work on each tiny pin individually.
Tools for the job:
1- 30x magnifier. The pins are so small that your typical 3-5x magnifier won't be enough to see them. I got the ‘SE 10X 20X 30X 21mm Chrome Loupes Pocket Magnifier New 3Pc’ from Amazon for $6.99. Great price!
2- Wiha 44501 Stainless Steel Fine Point Professional ESD Precision Tech Tweezers with Static Dissipative Grip and Hypo Allergenic, 130mm Overall Length
from Amazon for $13.79.
I used the magnifier and tweezers to raise and unbend each of those pins. I put the CPU back and started the computer.
The computer never rebooted by itself and I was happy my first troubleshooting fixed it. I was worried I had to get another motherboard.
I use a firewall which is set up to allow Internet access by any app on my system manually. Unless the app has been granted trusted access previously by me, I get a prompt whenever an app is trying to access the Internet. It displays the ip address it’s trying to connect to plus the port number. I download and install a lot of software and I need to know when & why a software is trying to connect to the outside. If the software is from a trusted application and I know it needs access, I give it a permanent permission. I can revoke it later if needed. When a piece of software wants access, my initial reaction is to deny it and see what happens. If it runs fine without the access, I know access was optional. The software vendor is probably collection some information for statistical purposes. Hopefully nothing more! And they do know that some users run software behind firewalls or on systems which physically have no Internet access.
Some software need to need have Internet connectivity for activation or registration purposes which is fine. I let the firewall remember their access on a case by case basis. If there’s software which has no business demanding Internet access, I most probably refuse it and uninstall it.
Here’s a little tip when trying software from untrusted sources. Install the software in a virtual operation system like VMware or Virtual PC or use a sandbox like SandBoxie which I have been using for years. I can right click on an .exe file and tell Windows to run the app inside Sandboxie. Sandboxie can show the registry keys the app tried to use. Sandboxie uses a virtual file system and you can view the contents of the system.
Play it safe.
Use SSL for any web page which has a form that captures sensitive information. The other day I was filling a survey which captured some sensitive information and I noticed the page wasn't secured. It was not using https. SSL is not for banking or credit care capture only. If there's any slight hint the captured information, if leaked, could do any kind of damage to the information owner, you as a web page owner, should secure the page by using an SSL certificate. An SSL certificate can be purchased cheaply for about $10 a year. A secured page gives more confidence to the web page user.
Here's a trick to get a cheaper GoDaddy cert than their advertised cert on their site. Google for 'cheap SSL cert' or Google for some of their cheap competitors certs and you might see a GoDaddy sponsored ad popping for cheaper than any of their competitors. I don't guarantee this is true every time. Last time I shopped for a cert I noticed GoDaddy's ads trying to get me as a customer. Try different keyword combinations. Something will trigger a GoDaddy cheap cert ad. Use the link in the ad as it will go to a special page for the lower price.