CLI Install


(Greg Sherwood) #1

To install MySource Matrix from the command line (in case the web based installer doesnt work for you), do the following.


Assume you've extracted matrix to /home/matrix and you have created your database:

    cd /home/matrix
    php install/step_01.php . (there may be some notices generated - ignore them)
    vi data/private/conf/main.inc


You'll have to edit this file manually to setup your system. The config options to worry about are:
SQ_CONF_DB_DSN
SQ_CONF_DB2_DSN

These two can be the same to start with and are in the form:
DB_TYPE://USER:PASS@DB_HOST/DB_NAME
[s]eg. mysql://root@localhost/matrix[/s]
eg. pgsql://matrix:password@unix()/matrix

[b]SQ_CONF_ROLLBACK_ENABLED[/b]
Set to '1' if you want to try rollback (you can turn if off later)

[b]SQ_CONF_SYSTEM_ROOT_URLS[/b]
Enter the URL of your system without http:// (eg. 'www.mysite.com/~myname')

Then complete the install:

[b]For MySource 3.4.x or earlier, you only need to run:[/b]
    php install/step_02.php .
    php install/step_03.php .


[b]For MySource 3.5.x, 3.6.x or later, extra commands need to be run due to new localisation features in these versions. Only Australian English is available at this point. Run:[/b]
    php install/step_02.php .
    php install/compile_locale.php . --locale=en_AU
    php install/step_03.php .
    php install/compile_locale.php . --locale=en_AU


The first call to compile_locale.php is to compile and cache core strings, internal messages and errors - this needs to be done before step 3, otherwise you may find some assets (generally the pre-installed cron jobs) may have "source string not found" problems. The call after step 3 compiles the localisation data for the assets just installed.

When you run the step 3 install, you should also run compile_locale.php afterwards to ensure that any upgraded localisation data is up-to-date.

(J) #2

Greg -


Any idea why I'd be getting something like this?


[quote][root@mysource html]# php install/step_02.php .

Content-type: text/html

X-Powered-By: PHP/4.3.4



<br />

<b>Fatal error</b>:

        <div style="background-color: red; color: white; font-weight: bold;">

                You need to supply the path to the System Root as a query string variable called SYSTEM_ROOT

        </div>

      in <b>/home/mysite.com/html/install/step_02.php</b> on line <b>53</b><br />[/quote]



J


(Avi Miller) #3

It looks like you're using a CGI version of PHP, not a CLI version.



If you run

    $ php -v
you should see something like:


    PHP 4.3.7 (cli) (built: Jul 12 2004 09:22:29)
    Copyright (c) 1997-2004 The PHP Group


If it doesn't say (cli), you will need to compile a CLI-enabled version of PHP. This topic has a known-good configure line to recreate a seperate, cli-enabled installation of PHP for you.

(Kavi Buhorah) #4

ive tried installing matrix from the command line:



php install/step_01.php - this is fine … but where do i put



vi data/private/conf/main.inc?



when i type it at the prompt it says vi is not a recognized as an internal or external command, operable program or batch file


(Kavi Buhorah) #5

I figured it out but now i get this error message:


MySource Warning

File: [SYSTEM_ROOT]\core\include\package_manager.inc Line: 161

Message: Asset "design_area_menu_stalks" fails the "asset" requirement for "design_area_menu_recursive v0.1"

As specified by [SYSTEM_ROOT]/core\assets/designs/design_areas/menu/design_area_menu_stalks/asset.xml



what does this mean and how do i fix it?? when using the web based installer i get the same error message as well. help anyone?


(felix hudson) #6

Thanks for the instructions. worked great for me.
After following these instructions i have made it to the admin login.

But what passwd login do I use?

Where can I create this user?



Thanks for your help


(Luke Wright) #7

For a CLI install the user name is "root" and default password is "root" - naturally we suggest that you change it when you first log into the system. :slight_smile:


(Mike) #8

Hmmm I've got as far as running php install/step_02.php .


But when I do, it starts do its thing, and then spits out this error…


[quote]Fri 10/06/2005 16:20:35 [mysource warning] (/core/lib/db_install/db_install.inc:63) - XML_Parser: failed to open stream: No such file or directory



MySource Warning                                       



XML_Parser: failed to open stream: No such file or directory                                                         



Fri 10/06/2005 16:20:35 [mysource error] (/install/step_02.php:77) - TABLE INSTALL FAILURE[/quote]



Any thoughts what might be causing this and how I can fix it?


(Greg Sherwood) #9

Its probably looking for MYSOURCE_ROOT/core/assets/tables.xml


Make sure the user you are logged in as has access to that file (and the file exists).

In fact, you should make sure the user you are running the install as has write access to MYSOURCE_ROOT and sub directories just to be sure the install can run without problems. You can lock it down after that.


(Mike) #10

Hmmmm, thanks Greg… you werre right. For some reason the tables.xml file was missing. However, I fixed that, but now I am getting the following error message!


(man, I must bew close!!!)



Sun 12/06/2005 22:56:13 [mysource error] (/core/include/assertions.inc:479) - [ASSERT EXCEPTION] DB Error: syntax error

CREATE INDEX sq_ast_attr_val_concat ON sq_ast_attr_val ((assetid || '~' || attrid)) [nativecode=ERROR: parser: parse error at or near "(" at character 57] (LINE 263 IN /core/lib/db_install/db_install.inc)

±---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

| MySource Error |

|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

| [ASSERT EXCEPTION] DB Error: syntax error |

| CREATE INDEX sq_ast_attr_val_concat ON sq_ast_attr_val ((assetid || '~' || attrid)) [nativecode=ERROR: parser: parse error at or near "(" at character 57] (LINE 263 IN [SYSTEM_ROOT]/core/lib/db_install/db_install.inc) |



Any thoughts on where I am going wrong now?


(Avi Miller) #11

Your version of PostgreSQL does not support the concatenated index we use. Check the forums, because there are a few threads about this that explain how to edit tables.xml to remove the creation of this index.


(Mike) #12

Hmmm, I have Postgrsql version 7.3.9-RH. Should this not be OK as the minimum stated on your website is Version 7.3.6-RH?


(Avi Miller) #13

To support the index, you need at least PostgreSQL 7.4.3 (but I recommend the latest version of the PostgreSQL 7.4 branch) or PostgreSQL 8.0.


(Mike) #14

OK, I commented out the line as mentioned above, but now I get this error:


Wed 15/06/2005 22:12:51 [mysource error] (/core/include/assertions.inc:479) - [A SSERT EXCEPTION] DB Error: unknown error

CREATE INDEX sq_ast_attr_val_assetid ON sq_ast_attr_val (assetid) [nativecode=ER ROR: relation named "sq_ast_attr_val_assetid" already exists] (LINE 263 IN /cor e/lib/db_install/db_install.inc)







Wha twould be causing this now?

Surely I must be getting close!


(Greg Sherwood) #15

If your install died half way through, you need to clear that DB out and start again. Try dropping all the tables in the DB or dropping the DB and recreating it.


(Marcus Nyeholt) #16

Also, you'll need to remove the file versioning directories (data/private/file_repository) and any files created in the matrix/data directories.


(Mike) #17

Hmmmmm


I deleted the database, reinstalled it, went through the process and still get the same error message.



Any other thoughts what might cause this error?


(Mike) #18

OK… I have now got to step 3 of the CLI install without any errors, and the plpgsql language has been applied to my database!


However, when I run php install/step_03.php . I get the following error:





-jailshell-2.05b$ php install/step_03.php .

±------------------------------------------------------------------------------ -----------------------------------------------------------+

| MySource Error |

|------------------------------------------------------------------------------- -----------------------------------------------------------|

| [ASSERT EXCEPTION] DB Error: no such table |

| SELECT type_code, version, name, instantiable, allowed_access, parent_type, di r, customisation |

| FROM sq_ast_typ [nativecode=ERROR: Relation "sq _ast_typ" does not exist] (LINE 110 IN [SYSTEM_ROOT]/core/include/asset_manager. inc) |

±------------------------------------------------------------------------------ -----------------------------------------------------------+

-jailshell-2.05b$





Any thoughts what might now be causing this error ???


(Greg Sherwood) #19

Did you run step_02.php? This error indicates step 2 (which creates the DB tables) was either not run or failed.


(Marcus Nyeholt) #20

Or that if you ran step 2, the cached db info was still present in the data directories. It really is easier to just wipe the matrix directory and start again if you don't complete the install.