Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
24 stars 19 forks source link

Geeklog 2.2.1 version install fails #1043

Closed prbt2016 closed 4 years ago

prbt2016 commented 4 years ago

Hello,

I tried to install Geeklog 2.2.1 on PHP 5.6, Apache 2.2.34, MYSQL 5.5. However installer fails after entering the details i.e data directory path , db details and site config details (Installing with option MYSQL with Innodb and checking the utf8 option) and installing with all plugins option throws the following warning and error :

Warning: require_once(/home/user/public_html/manual/system/lib-database.php): failed to open stream: No such file or directory in /home/user/public_html/manual/geeklog221/admin/install/classes/installer.class.php on line 4712

Fatal error: require_once(): Failed opening required '/home/user/public_html/manual/system/lib-database.php' (include_path='.:/usr/local/apps/php56/lib/php') in /home/user/public_html/manual/geeklog221/admin/install/classes/installer.class.php on line 4712

What could be the issue?. Could you please replicate this at your end?.

eSilverStrike commented 4 years ago

So this is a new install correct? Not an upgrade?

Seems like some sort of directory issue. Does the file lib-database.php exist in the location:

/home/user/public_html/manual/system/lib-database.php

It looks like you unzipped your Geeklog install package in the directory

/home/user/public_html/manual/

correct, and left everything as is and ran the install? (ie you didn't move any files or directories around)

@mystralkk any other ideas?

prbt2016 commented 4 years ago

Hi @eSilverStrike ,

This is a new install and my public directory is inside '/home/user/public_html/manual/geeklog221', which is where I unzipped it and data directory unzipped in '/home/user/geeklog221data' which is the path I provided for data directory during installation.

The file 'lib-database.php' is in '/home/user/public_html/manual/geeklog221/system/lib-database.php'. But the location shown in error is '/home/user/public_html/manual/system/lib-database.php'.

Also when I debugged and checked the value of $_CONF['path_system'] (defined in '/admin/install/classes/installer.class.php' line 4712), it prints it as 'home/user/public_html/manual/system' instead of '/home/user/public_html/manual/geeklog221/system'.

eSilverStrike commented 4 years ago

And what was your site URL planning to be (I assume there are directories involved in it)? (use a fake IP or domain name instead of the one you would actually use so it is not public knowledge)

So to sum up you have everything from the install package in (as it came in the zip file)

/home/user/public_html/manual/geeklog221/

except the 'data' directory which is in

/home/user/geeklog221data/

What happens if you put the data directory back in

/home/user/public_html/manual/geeklog221/

eSilverStrike commented 4 years ago

Reading the whole issue again one of your statements has me confused

However installer fails after entering the details i.e data directory path

We never ask for the data directory path in the install.

I believe the only path we ask for is the one to the db-config.php file if it cannot be found.

The Geeklog Install assumes you unzip the entire contents of the package in one directory. All the files and directories must stay like that except the public_html directory (and the files and directories below it) which if you want you can move to somewhere else.

This way the Geeklog install knows where the public_html directory is as that is is the location of the install files you are currently running, and it can find everything else once it knows the location of db-config.php.

prbt2016 commented 4 years ago

Yes right I gave path as '/path/to/datadir/db-config.php' , while starting installation . From the zip I put contents of 'public_html' folder inside /home/user/public_html/manual/geeklog221/ and other files in /home/user/geeklog221datadir/.

Still same error. Older version i.e 2.2.0 works properly with same setup.

eSilverStrike commented 4 years ago

And what was your site URL planning to be?

So this is different than your first setup correct for the original issue? As from what you told me your lib-database.php should be located in

/home/user/geeklog221datadir/system/

and not as you stated before in:

/home/user/public_html/manual/geeklog221/system

prbt2016 commented 4 years ago

Yes you got it right now .system folder is in /home/user/geeklog221datadir/system

eSilverStrike commented 4 years ago

and what is your exact error with the new setup? (and when you debug $_CONF['path_system']).

Also you haven't mentioned the site URL you entered in the configuration which can make a difference. Which directory are you pointing the website at?

I need to know if it is something like www.example.com or www.example.com/mygeeklogsite

prbt2016 commented 4 years ago

I am pointing to http://www.myvm.com/manual/geeklog221.

eSilverStrike commented 4 years ago

and what is your exact error with the new setup? (and when you debug $_CONF['path_system'])

The reason I need you to be specific is I cannot reproduce your issue and want to make sure I know what the exact path Geeklog is looking at in the install code.

I am pointing to http://www.example.com/manual/geeklog221

From the zip I put contents of 'public_html' folder inside

/home/user/public_html/manual/geeklog221/

and other files in

/home/user/geeklog221datadir/

eSilverStrike commented 4 years ago

Are you able to give us the error information?

prbt2016 commented 4 years ago

Okay let me explain you in detail with screenshots. This is my directory structure .

/home/user/public_html/manual/geeklog221 geeklog_folder

The directory 'geeklog221' contains contents of 'Geeklog's' public_html folder.

My data directory is in /home/user/geeklog221data/ (I have created geeklog221data in /home/user/geeklog221data and it contains the following:

data

When i start the installation I hit the following url :

http://www.domain.com/manual/geeklog221/

Installer asks for 'db-config.php' path so here is my path:

'/home/user/geeklog221data/db-config.php'

At the last step of installation following error is thrown :

Warning: require_once(/home/user/public_html/manual/system/lib-database.php): failed to open stream: No such file or directory in 
/home/user/public_html/manual/geeklog221/admin/install/classes/installer.class.php on line 4712 

Fatal error: require_once(): Failed opening required '/home/user/public_html/manual/system/lib-database.php' (include_path='.:/usr/local/apps/php56/lib/php') in /home/user/public_html/manual/geeklog221/admin/install/classes/installer.class.php on line 4712

So when I echo $_CONF['path_system'] in installer.class.php below line 4711, it shows me

/home/user/public_html/manual/system/

But this is wrong directory it is pointed to since my system folder is at path

'/home/user/geeklog221data/system'

Also I have checked siteconfig.php in /home/user/public_html/manual/geeklog221/siteconfig.php. It has filled the correct value of $_CONF['path'] which is

'$_CONF['path'] = '/home/user/geeklog221data/';'

Also when i echo this code $_CONF['path_system'] = $_CONF['path'] . 'system/'; in siteconfig.php through browser, it gives me correct path i.e /home/user/geeklog221data/system/

Anything else that i can debug?

eSilverStrike commented 4 years ago

Thanks for the details. I will look into this further.

eSilverStrike commented 4 years ago

Okay it should be fixed now (tested on new installs, upgrades, and migrate). Can you double check and confirm?

Update your installer.class.php file from the repository: https://github.com/Geeklog-Core/geeklog/blob/a4fd342f378688985fe244de96f1151e906b0b08/public_html/admin/install/classes/installer.class.php

prbt2016 commented 4 years ago

Hello @eSilverStrike ,

Install works perfectly fine without any issues with that patch. I do face an issue while upgrade from 2.2.0 to 2.2.1. Post clicking on 'Upgrade->Continue', I get this error i.e

Fatal error: 1146: Table '{DB-NAME}}.{{TABLE-PREFIX}}topic_assignments' doesn't exist in /home/user/geeklog/system/databases/mysqli.class.php on line 468

Could you please check upgrade from 2.2.0 to 2.2.1?. For your kind information I am using MYSQL 5.5.62.

eSilverStrike commented 4 years ago

Is your table prefix different than the default of 'gl_' ?

I found an issue in the upgrade sql that had the table name gl_topic_assignments hard coded. It is now fixed so if you can grab the latest mysql_2.2.0_to_2.2.1.php and replace the file on your server.

eSilverStrike commented 4 years ago

Did the update work for the upgrade?

prbt2016 commented 4 years ago

Hey @eSilverStrike ,

It does work fine now for upgrade. Thanks a lot.

eSilverStrike commented 4 years ago

No problem. Thanks for reporting the issue and testing.