Joomla not working on Localhost:8000

homebrewMySQLPHPterminal

I was migrating a Joomla site to a new server. Before uploading to the new server, I wished to test it on my localhost php server. I have done this with WordPress sites and other PHP/MySQL things with no problems but for some reason Joomla is giving me issues.

I CD to the websites folder in the terminal and start php using my homebrew install of php 5.6.7:

/usr/local/Cellar/php56/5.6.7/bin/php -S localhost:8000

When trying to access the Joomla site locally, the page gives the error message:

This webpage is not available.

In terminal, this is the output I receive:

[Wed Apr  8 11:40:34 2015] PHP Deprecated:  iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in /Users/AdvancedNetworks/Documents/Websites/carzmetix/new-site/libraries/joomla/string/string.php on line 27
[Wed Apr  8 11:40:34 2015] PHP Deprecated:  iconv_set_encoding(): Use of iconv.input_encoding is deprecated in /Users/AdvancedNetworks/Documents/Websites/carzmetix/new-site/libraries/joomla/string/string.php on line 28
[Wed Apr  8 11:40:34 2015] PHP Deprecated:  iconv_set_encoding(): Use of iconv.output_encoding is deprecated in /Users/AdvancedNetworks/Documents/Websites/carzmetix/new-site/libraries/joomla/string/string.php on line 29
[Wed Apr  8 11:40:37 2015] PHP Notice:  Undefined variable: extension in /Users/AdvancedNetworks/Documents/Websites/carzmetix/new-site/templates/forte/layouts/default/layout.php on line 80

(Note: I have MySQL and Phpmyadmin installed locally so I imported the database onto my localhost.)

I double checked that I did not input the DB credentials incorrectly by changing the configuration.php file. When the info was incorrect, I would see an error that told me that there was an error connecting to the MySQL database.

Also: Accessing the administration page gives the same errors.

Do I need to install additional php extensions for Joomla to work? If so, I can get that via Homebrew.

Note: I uploaded the same files onto Hostgator and imported the same SQL file and it worked there so I must have done something incorrectly on the localhost machine.

What can I do? Thank you!

Best Answer

After further research, I saw that Joomla 3.x does not work with php version 5.6 (which is what I was using)

If you are having this issue, I recommend using Homebrew to get php 5.4 or 5.3.

I did the following:

brew install php54

In one terminal tab, I have php5.6 running with the following command:

/usr/local/Cellar/php56/5.6.7/bin/php -S localhost:8000

In another terminal tab, I have stable php 5.4 running with the following command:

/usr/local/Cellar/php54/5.4.39/bin/php -S localhost:8001

(Both have the same document root (website folder) so both can access MySQL just fine.)

So going to http://localhost:8000/ will go to my php 5.6 server while http://localhost:8001/ will go to my php 5.4 server.

Joomla is working like a charm on my php 5.4 test server.

I suppose it should have been common sense to use a more stable version of php rather than the newest one but hopeful this helps someone!