Phoca Extensions
Free extensions for Joomla! CMS

Installation Problem Solving

Category: Phoca Gallery Component

Phoca Gallery is a large component, so problems can occur on some servers while installation. Mostly there are two main problems.

 

 

alt

Phoca Gallery tables were not created while installing

Mostly you get the following system message "Error while Saving Phoca Gallery Categories" or this PHP error message: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource ... while using Phoca Gallery.

Getting this system message or php error message is caused by not installed Phoca Gallery tables in the Joomla! database. Please enable debug mode in your Joomla! administration site (Global Configuration) and take a look at your database (e.g. via phpMyAdmin) to see if the installation script created Phoca Gallery tables correctly. If not, you have to create them manually. The SQL queries, which install Phoca Gallery tables into your database, are stored in install.bak file. You will find this file in the root of Phoca Gallery component ZIP package. Since Joomla! 3 (Phoca Gallery 4) you will find the SQL files in ZIP package in folder: install/sql/mysql/ (e.g. install/sql/mysql/install.utf8.sql)

 

If you are installing Phoca Gallery,

just copy all SQL queries (except ALTER TABLE ... queries) and run them in e.g. phpMyAdmin. But beware, because the names of tables are prepared for system installation, so they contain '#__' instead of your table prefix, you have to rename them, e.g.:

  • #__phocagallery to TablePrefix_phocagallery

TablePrefix is the prefix you selected while installing Joomla! CMS (it is mostly 'jos_' and it should differentiate the Joomla! tables from other tables used in your database). Make sure that you delete #_ at the start of the line; you only need one _ {underscore}. Do this for all queries.

 

If you are upgrading Phoca Gallery,

and you get problems with not created tables or columns, you need to open the install.bak file which you can find in root of the installation ZIP file and compare it with your database. E.g. with help of phpMyAdmin tool. Since Joomla! 3 (Phoca Gallery 4) you will find the SQL files in ZIP package in folder: install/sql/mysql/ (e.g. install/sql/mysql/install.utf8.sql)

In install.bak or install.utf8.sql file you can see which new tables and columns were added in previous versions. So if some table doesn't exists in your database and you can see the SQL query for this table in install.bak file or install.utf8.sql, just run this query (query for creating one table) so this table will be added into your database (Don't run all the queries as they can overwrite your current data in your site, which means deleting all your data).

You need to check the upgrade sql queries too (upgrading columns in tables). If you compare the table in your database with SQL query of the install.bak file or install.utf8.sql  and you will recognize that some columns don't exists in your tables, you need to run the SQL upgrade queries (which are prepared at the end of the install.bak file or install.utf8.sql ). After copying and pasting the queries into phpMyAdmin you need to remove comments characters (-- at the begin of the line) and you need to modify the prefixes.

Upgrading the tables:

Because the names of tables are prepared for system installation, so they contain '#__' instead of your table prefix, you have to rename them:

  • #__phocagallery to TablePrefix_phocagallery
  • #__phocagallery_categories to TablePrefix_phocagallery_categories, etc.

TablePrefix is the prefix you selected while installing Joomla! CMS (it is mostly 'jos_' and it should differentiate the Joomla! tables from other tables used in your database). Make sure that you delete #_ at the start of the line; you only need one _ {underscore}.

Upgrading the columns:

If you have all tables in your database (e.g. you are upgrading from 2.1.0 to 2.2.0) check the columns of your tables. E.g. in Phoca Gallery version 2.2.0 there are new colums: extlink1, extlink2 and these should be added into table: #__phocagallery. In case you are upgrading e.g. from 2.1.0 to 2.2.0 and you got some error message while automatically upgrading of Phoca Gallery tables (tables and columns not created, check the #_phocagallery table and if extlink1 or extlink2 columns aren't included, then run the SQL query for 2.2.0 version:

ALTER TABLE `#__phocagallery` ADD `extlink1` text NOT NULL AFTER `params` ;
ALTER TABLE `#__phocagallery` ADD `extlink2` text NOT NULL AFTER `extlink1` ;

If you're upgrading to 2.2.2 then run also the SQL query for the 2.2.2 version:

ALTER TABLE `#__phocagallery_categories` ADD `date` datetime NOT NULL default '0000-00-00 00:00:00' AFTER `description` ;

You need to check all upgraded SQL queries which were added to current version and run them if the columns don't exist in Phoca Gallery tables.

Phoca Gallery is not installed and blank page is displayed

If you get blank page while installing Phoca Gallery. It can be caused by not enough PHP Memory or CPU on your server. Installation procedure in Joomla! doesn't have enough time for unzipping Phoca Gallery ZIP file.

In this case the best way how to install Phoca Gallery is uploading data via FTP. But it is not all you need to do because some information about Phoca Gallery (menu items) should be stored in Joomla!.

You should do the following steps (copying files and creating folders should be done by FTP client, see this article for more information):

1.Download the latest Phoca Gallery ZIP file and unzip it somewhere on your PC. E.g. create phocagallery_tmp folder on your PC and unzip the file here.

2. Create the following folders on your server (where Joomla! is running):

  • components/com_phocagallery
  • administrator/components/com_phocagallery
  • images/phocagallery

3. Copy all folders and files (except front and language folders and their files) from phocagallery_tmp folder into your server's folder:

  • administrator/components/com_phocagallery

4. Copy all files which are saved in front folder on your PC ( phocagallery_tmp/front ) into your server's folder:

  • components/com_phocagallery

5. Copy all files which are saved in languagefolder on your PC ( phocagallery_tmp/language ) into your server's folders:

  • language
  • administrator/language

Now all needed files should be saved on your server.

6. Download com_phocagallery_ftp_install.zip file from Phoca Gallery download site and install it in your Joomla! administration site:

Go to Extensions » Install/Uninstall. Now you are in Extensions Manager. Click on:

This file is very small. It doesn't contain Phoca Gallery files (these were copied by FTP), so there shouldn't be any problem with PHP Memory or CPU anymore. After installation you can select if you want Install or Upgrade Phoca Gallery.

 

 

 

Phoca Forum - Latest Topics