Thursday, March 19, 2009

Joomla - Extensions will not Install

While Joomla running on a USB stick with xampp works pretty well, we cannot install any extensions so no new modules, themes or other neat stuff. The problem is the paths for the log and tmp. They get hard-coded at installation and while you can easily change them in the global configuration settings the question is to what? And do you have to change the php basedir setting too?

The joomla documentation is vague and provides no examples of a working configuration. So we decided to install joomla on the old windows 2000 server in the basement. This runs the apple 360 laser printer - old but reliable and it will not die, and the big old 17" HP scsi scanner. It also runs an old version of LAMP that the malagasy project uses so that maintenance can be done when needed.

So we download and unpack the joomla .zip from the joomla web site. Version 1.5.9 is the latest. Actually, i forgot this server does not have phpmyadmin installed so let's just fire up WAMP on a machine and do an install there.

We create a joomla folder in c:\wamp\www and extract the Joomla_1.5.9.zip files there. We next click on the php.ini file in a text editor or at least we wait while windows finishes extracting and copying files. You get so used to osx and linux where this kind of file manager tie up never happens....Of course we can switch to notepad and open the file and set display errors=off but since we are just wanting to do this to see what the paths are we decide not to.

So we start wampserver and goto http://localhost/phpmyadmin to create the joomla database with:

CREATE DATABASE `joomla`
DEFAULT
CHARACTER SET utf8

COLLATE
utf8_unicode_ci;


Next we set create a new user called joomla for the joomla database with localhost only.

GRANT USAGE ON * . * TO 'joomla'@'localhost'
IDENTIFIED
BY '******'
WITH
MAX_QUERIES_PER_HOUR 0
MAX_CONNECTIONS_PER_HOUR
0
MAX_UPDATES_PER_HOUR
0 ;


Now to set the permissions to everything for the joomla user on the joomla database on localhost.

GRANT ALL PRIVILEGES ON `joomla` . *
TO
'joomla'@'localhost'
WITH
GRANT OPTION ;


Now that the mysql bits are taken care of, time to install joomla which is a browser-based install. All we have to do is goto http://localhost/joomla and the index.php installation file runs.

We select English as the language, we note the non-fatal warning about php having display errors set to on and ignore it, carefully read the EULA, and select mysql as the database type, localhost as the host hame, joomla as the username and password and joomla as the database name. Since this is a local install and not on a remote server we do not turn on FTP. We give it a site name, our email address, a password for the admin user and load the sample data.

Now we go back to the file manager and delete the joomla/installation folder and then click on the Admin icon to get to the back-end control panel. We login as the admin user.

We select Site, Global Configuration and click on the System settings. Here are what it did:

The path to the Log Folder is: C:\wamp\www\joomla\logs so we were correct in that the installation hard-codes the path. This does make portable operation a bit difficult. It would be better IMHO if the path was relative to the web root (/joomla/logs).

The path to the temp-folder is C:\wamp\www\joomla\tmp which has the same issue as above.
We think the Joomla global configuration settings are held in the joomla/configuration.php file. So we check that and see:

var $log_path = 'C:\\wamp\\www\\joomla\\logs';
var $tmp_path = 'C:\\wamp\\www\\joomla\\tmp';

This is exactly what we need to know - the actual format of the setting in the php file. The question now is how to change that for an XAMPP install. We also note the improved format of the configuration file along with comments. This is one of the improvements in 1.5.9 over the 1.5.8 version we installed a couple of weeks ago. Raises the question on how to upgrade.

But before we do that best to test if extensions can be loaded on the wamp setup.

Testing Loading Extensions

This is the big test - on Xampp installs any extension install using Extenstions, Install/Uninstall fails with the error:

* JFolder::create: Infinite loop detected
* Warning! Failed to move file.


We believe the problem is related to the fact the install drive letter is most likely different from the current drive letter. This happens when you move your USB stick or pocket drive from windows machine to machine.

We select Extensions, Install/Uninstall
Click BROWSE
We choose a new theme we downloaded 1206321574.zip
Click Upload File & Install
Install Template Success!

So off to the template manager to see our new toy. The default template is milkyway so we change it to js_jamba which is our new template and take a preview. Very St. Patrick's day.

Ok, lets try some extensions like joomlapack 2.1 from http://www.joomlapack.net and and joomlaexplorer 1.6.3 and JCE 1.51.

Success - joomlapack installs and adds itself to the Components menu. Sweet. JCE installs successfully and adds itself to the components menu but joomlaexplorer gives a warning - older version of joomla.

Ok now we need to shut down WAMP and bring up XAMPP but before we do that let's check the settings in the xampp/joomla/condiguration.php file.

var $log_path = '\\xampp\\htdocs\\joomla\\logs';
var $tmp_path = '\\xampp\\htdocs\\joomla\\tmp';

Which is basically the same as the WAMP one that works, except we had removed the drive letter in the joomla global configuration settings. That didn't work. This raises the question of do the paths have to be hard-coded? ouch if true! but it does present a workaround - change the drive letter in the global configurations to match the drive letter assigned by windows - a pain in the butt but it can be done while a more flexible solution is found.

So let's test out our theory by changing the setting in Joomla and trying to install again.

Run Xampp and bring up joomla
Select Site, Global Configuration
Our current drive letter is J: so we add that to the Path to Temp-folder so it is now:

J:\xampp\htdocs\joomla\tmp
Click SAVE
In the System tab we change the Path to Log folder to:
J:\xampp\htdocs\joomla\logs
Click SAVE

We get the message that the global configuration details have been updated. Ok let's check the configuration.php file to be sure.

var $log_path = 'J:\\xampp\\htdocs\\joomla\\logs';
var $tmp_path = 'J:\\xampp\\htdocs\\joomla\\tmp';

Which look right. Now the big test- let's load the same template theme we did in WAMP.

Select Extensions, Install/Uninstall
Select the .zip file of the extension
Click File Upload and Install

We get an error - could not find an XML setup file in the package
We try joomlapack next. We get a timeout error - max of 60 seconds exceeded

The likely problem is that we made some changes to php.ini and other files based on postings to web sites. This may have made things worse. So we need to undo those changes or restore from the backup.

We select restore from backup so we can have some lunch...

With the previous backup restored we try again to install the template. No joy. Ok let's restore the backup before the backup. We want to go to the point before we made changes to php files. Although we commented those changes and kept notes, there were a number of them and it is just easier to restore to an original configuration.

Ok we have the backup restored. Back to install the extension. Same could not find an xml file. Try a second theme. This is better - we get an error but it says the extension is for an older version. Let's try JCE. We get a white screen on this one. Localhost seems to be running very slow. I think i'll shut the whole thing down and go from scratch. I had problems in the past with time-outs and since i went to lunch that may be a factor.

No joy here.

The next option is an upgrade from .8 to .9, right new we are running 1.5.8 (select help, system info) and there is a patch to upgrade to 1.5.9 (1.5.8 to 1.5.9 Upgrade Package) at http://www.joomla.org/download.html and patches to upgrade from other versions to 1.5.9 at http://joomlacode.org/gf/project/joomla/frs/.

The methods seems to be to unpack the files and to copy them to your joomla folder overwriting the old files. Ok so we try that and we are now at 1.5.9

Back to the extension install routine. No joy with the theme, we try joomlapack. Same 60 second time out. The other option is a clean install of joomla.

Fresh Install of Joomla

We delete the joomla directory and start again. This time we install 1.5.9 from scratch. Odd it times out - which proves our point about localhost being slow on this machine. Why? We get waiting for localhost. The device is a usb 2.0 80 gig SATA drive so it is not slow. Windows doing something stupid? We edit the registry to remove some sketchy looking stuff - god, xp is a pain of an os.

Let's try a usb stick. First we edit configuration.php so that the drive letters match, then launch joomla. This was a fresh install from yesterday it is 1.5.9 and has no changes to files.

We try to install an extension starting with the theme that worked in WAMP. We get the error about xml setup file not found. At least it was quick. We try joomlapack. Waiting for localhost. It white screens. Try JCE. Waiting for localhost and it white screens. Shut it down.

Maybe we should try another machine. Off to the laptop. What a difference - localhost is zippy - must be something on the other windows machine that slows usb connections to a crawl. Wonder if that is part of the problem in the lab the other day - anti-virus software trying to deal with that usb virus by scanning every read/write.

We try to install the extension and get the same:

'Error Could not find an XML setup file in the package'

Try another. JCE. This time we get a message:

Another component is already using directory com/jce

We see that both JCE and Joomlapack actually created folders in the joomla/administrator/components and joomla/components directories. This was from the previous aborted installs.

We delete the folders and try again. It times out after 60 seconds. Should we change php.ini to increase the max_execution_time value? Ok - why not - we change it to 120 seconds, save and restart the servers and try to install an extension again. It whitescreens. (says done as before). but of course does not show up in the components list like with WAMP.

This makes me wonder if Joomla on XAMPP can install extensions. We need to find a working example.

Apache and php.ini

One thing just occured to me - we have been editing the php.ini file in the php directory but i recall that Apache has it's own php.ini file in the xampp\apache\bin folder

This might explain why in the lab yesterday we turned off the display but joomla still reported it as on. Let's take a look at file.

Intereresting this is set to nothing.

;open_basedir =

May affect ftp mode but should not affect local installs so we leave it alone. We do change the next line from on to expose_php = Off and increase the script execution time to 2 minutes with max_execution_time = 120 and turn off error display with display_errors = Off

We see the file upload directory is set to \xampp\tmp although that is used for php session variables and not by joomla.

enough for today. Will try and find a solution tomorrow...


















3 comments:

Unknown said...

So... did you find a solution? I've been tearing my hair out trying to install an extension in Joomla on XAMPP (on OSX) with no luck. You r article was the closest thing to a solution I've come across.

iSupportGuy said...

Get Professional Joomla Setup for $49
Visit www.isupportguy.com for quick Setup.

joomla said...

Its interesting. I would like to know more about this…I really wanted to know how this works can you please help me out…….Thanks for sharing.
joomla extensions