Some of your have asked me to create a tutorial for Mac for running rankingfactors.pl script. This post is the answer to your queries. Without further ado here are the steps:
PART 1 – Installing XAMPP & Copying Files
1> Download XAMPP for Mac at this link
2> Install XAMPP using instructions at: this link (just a couple of steps)
3> At this point you can go to the htdocs folder on your Mac (/Applications/XAMPP/htdocs)
4> You can cleanup this folder by placing all files and folders into a single folder or leave it as is.
5> Assuming you have downloaded the windows version of SEO Warrior (xampp distribution) simply copy all files and folders from the ‘htdocs’ (windows) to your Mac ‘htdocs’ folder.
6> Copy TreeBuilder.pm, Element.pm from the Windows (zip:\xampp\perl\site\lib\HTML) distribution to /Applications/XAMPP/xamppfiles/lib/perl5/site_perl/5.10.0/HTML/
7> Copy Round.pm from the Windows (zip:\xampp\perl\lib\Math\MATH) distribution to /Applications/XAMPP/xamppfiles/lib/perl5/5.10.0/Math
With this step you will avoid getting the following error message:
Can't locate HTML/TreeBuilder.pm in @INC (@INC contains: /Applications/XAMPP/xamppfiles/lib/perl5/5.10.0/darwin-2level /Applications/XAMPP/xamppfiles/lib/perl5/5.10.0 /Applications/XAMPP/xamppfiles/lib/perl5/site_perl/5.10.0/darwin-2level /Applications/XAMPP/xamppfiles/lib/perl5/site_perl/5.10.0 .) at rankingfactors.pl line 25.
8> Next we need to setup the path. You can execute the following command in a Terminal window (just for this window session) or place it in your .profile file (as a more permanent solution). Note: this is a single line and the only white space is after the ‘export’ word.
export PATH=/Applications/XAMPP/xamppfiles/lib/perl5/5.10.0:/Applications/XAMPP/xamppfiles/lib/perl5/site_perl/:/Applications/XAMPP/xamppfiles/bin/:$PATH
You are now ready to run the script. Simply go to the /Applications/XAMPP/book/downloads/chapter-4 folder. (i.e. rankingfactors.pl 10 buy shoes)
That’s it! These instructions could also be helpful for Linux installations as well (especially the modules part).
Regards,
John
Tags: mac ranking factors script, mac tutorial, rankingfactors.pl
I already have xampp 1.7.2 installed, what do I do?
Please follow the tutorial from step (3). If you have installed everything using defaults it should be easy. Otherwise, make sure that your directory structure is the same or adjust the paths according to your current XAMPP directory setup.
Regards,
John
Hi John, I am on a Snow Leopard Mac, and followed your instructions. Installed xampp fine, copied the files as described, created a .profile file and pasted in the path, but still get the @INC error, and now xampp seems not to be working either:
Warning: file_put_contents(../../install/xampp_language.txt) [function.file-put-contents]: failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/xampp/lang.php on line 2
Warning: Cannot modify header information – headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/xampp/lang.php:2) in /Applications/XAMPP/xamppfiles/htdocs/xampp/lang.php on line 10
I also get errors when trying to run getRanking.pl (and have to run it from the same directory in terminal).
sh: wget: command not found
sh: line 1: –output-document=gserp.html: command not found
sh: wget: command not found
sh: line 1: –output-document=bserp.html: command not found
number of tokens:-1number of tokens:-1
Any thoughts or help? Would very much like to run the scripts!!!
Hi Mark,
I would suggest following all the steps first (manual approach without the .profile part). I would also reinstall your xampp since it looks like it is no longer working.
For the getRanking.pl script, you would need to download wget command for Mac. As long as wget is in your path it should be okay. Here are some links that should help:
- http://www.mactricksandtips.co.....minal.html
- http://wget.darwinports.com/
I hope that helps!
Regards,
John