Installation help
Hello,
I'm installing CA on Ubuntu 22.04 and did everything by the installation manual.
I can acces install page on <local_ip>/providence/install but all I can get is webpage with this text "Collective Access - Version 1.7.17 installer (XML) (see in attached image). It is not clickable, I can not do anything with it.
When I check my PHP, I get this:
php -v
PHP 7.4.33 (cli) (built: Sep 2 2023 08:03:46) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
When I go to <local_ip> in browser I get apache welcome page - Apache2 Default Page It works!
When I type in sudo systemctl restart apache2.service it gives me no error message back.
Where do I do wrong?
Tnx :)
Comments
Looks like something is stopping it from loading the rest of the page. Look in your logs, or check the developer tools of your browser for any errors.
Yes, in apache error.log I got this while trying to open that installation page:
[Thu Sep 07 10:43:48.259294 2023] [php7:error] [pid 750] [client 192.168.50.189:65362] PHP Fatal error: Uncaught DatabaseException: Your PHP installation lacks MySQL support. Please add it and retry... in /var/www/html/providence/app/l>
This is from app/log
2023-09-07 12:21:21 - ERROR --> DatabaseException: Your PHP installation lacks MySQL support. Please add it and retry...
You need to install some missing PHP extensions, including the very basic mysql extension.
I did this:
And after that, I edited two php.ini files:
/etc/php/7.4/cli/php.ini
/etc/php/7.4/apache2/php.ini
I edited those ini files, removed there two semicolons in front of extension=mysql i extension=pdo_mysql and changed directory path with this:
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
extension_dir = "/var/www/html/providence/app/" ; removed semicolon in front of that
But with no luck.
You don't need to remove the semi colons in php.ini, this is for windows installs.
Make sure the module is in the modules-enabled directory. You might need to install the 7.4 version of the module
Make sure you have all the other php modules you need installed also. Follow the instructions for this on the manual page.
Remember to restart Apache after making changes.
I did everything and got this:
PHP Document Object Model (DOM) module is required for CollectiveAccess to run. Please install it.
The PHP cURL module is required for CollectiveAccess to run. Please install it.
The PHP ZipArchive module is required for CollectiveAccess to run. Please install it.
So i installed all those modules for PHP7.4 but this new error won't go away.
Still not luck with installation. I tried to install everything from scratch.
Can I ask, why when I try to install PHP7.4 get also PHP8.2 .
I tried with Ubuntu 20.04 and one with Ubuntu 22.04.3.
I'm doing exact steps to the letter using your support_uploads.txt but no luck.
In my last installation I got this error in apache2 log.
[Fri Sep 08 12:42:09.660762 2023] [php:error] [pid 61633] [client 192.168.50.189:59711] PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /var/www/html/ca/app/helpers/utilityHelpers.php
I suppose the problem is with PHP. I installed it exactly as you instructed
php -v gives me:
PHP 7.4.33 (cli) (built: Sep 2 2023 08:03:15) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
But also, when I check sudo update-alternatives --config php
There are 2 choices for the alternative php (providing /usr/bin/php).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/php8.2 82 auto mode
* 1 /usr/bin/php7.4 74 manual mode
2 /usr/bin/php8.2 82 manual mode
What can I do?
Which error?
Make sure you follow these instructions https://manual.collectiveaccess.org/providence/user/setup/install/Ubuntu_20.04.html#install-ubuntu-20-04 paying attention to all the modules and libraries that need to be installed.
I was using this guide, don't know is it any differrent, but I'll do it once again.
sudo apt update
sudo apt upgrade
## Install Apache ##
sudo apt install -y apache2
sudo systemctl enable apache2.service
sudo systemctl start apache2.service
## Install PHP 7.4 ##
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install -y php libapache2-mod-php7.4 php7.4-mbstring php7.4-xmlrpc php7.4-gd php7.4-xml php7.4-intl php7.4-mysql php7.4-cli php7.4-zip php7.4-curl php7.4-posix php7.4-dev php7.4-redis php7.4-gmagick php7.4-gmp
sudo update-alternatives --config php ## Select PHP 7.4 ##
php -v
sudo vi /etc/php/7.4/apache2/php.ini ## Change memory_limit 256m / upload_max_filesize 64m / post_max_size 128m ##
sudo systemctl restart apache2
## Install MySQL ##
sudo apt install -y mysql-server
sudo systemctl start mysql
sudo systemctl enable mysql
sudo apt install -y ghostscript libgraphicsmagick1-dev libpoppler-dev poppler-utils dcraw redis-server ffmpeg libimage-exiftool-perl libreoffice mediainfo
## Clone Providence ##
cd /var/www/html
sudo git clone https://github.com/collectiveaccess/providence.git ca
cd /var/www/html/ca
sudo cp setup.php-dist setup.php
## Configue MySQL ##
CREATE DATABASE my_archive; ## Set database name ##
SHOW DATABASES;
CREATE USER user_name@localhost identified by 'set_password'; ## Set 'user_name' & password ##
GRANT ALL on my_archive.* to user_name@localhost; ## Set database name & user_name ##
exit
## Configure setup.php ##
cd /var/www/html/ca
vi setup.php ## Set database login settings __CA_DB_USER__, __CA_DB_PASSWORD__, __CA_DB_DATABASE__.##
sudo systemctl restart apache2.service
## Ensure can write to folders ##
cd /var/www/html/ca
sudo chown -R www-data app/tmp app/log media vendor ## If gives error that tmp does not exist, create tmp ##
cd /var/www/html/ca/app ## Only run the next two lines if above fails ##
sudo mkdir tmp
sudo chown -R www-data app/tmp app/log media vendor
sudo chmod -R 755 app/tmp app/log media vendor
You're probably running one version of PHP in the web server and another on the command line. Please make sure you're running PHP 7.4 in both places. One way to do this is to run a2dismod on module php8.2, and then a2enmod on php7.4. Eg. run these commands:
The module errors are likely due to your installing them for PHP 7.4 only, while you're actually running PHP 8.2 in the web server. If I'm correct about this, then changing the web server to run PHP 7.4 will resolve it.
Thnx, it is working now.