I do not have an admin account on my OSSN website

jj Bird Posted in Technical Support 2 years ago

Hello, I created my ossn page, but after the part with the mysql details, it threw an error, i then refreshed the page, and ossn was installed, but that means i did not cover the step with making the admin account, meaning there is simpy no admin account whatsoever. How can I add the admin account through cpanel?

Replies
Breton Rafael [redcrested.net] Replied 2 years ago

I didn't bypass the version check. I put on the .htaccess file the SetHandler parameter to configure php version in the ossn folder.

<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
    SetHandler application/x-lsphp81
</FilesMatch>

In install routine, after clicking on next step, apparently SetHandler parameter is gone and I need to send my version of .htaccess again.

Thanks for add this issues on GitHub.

Merry christmas to everyone!!

Indonesian Arsalan Shah Replied 2 years ago

@Michael, I agree with you version compare is only full proof method. Created https://github.com/opensource-socialnetwork/opensource-socialnetwork/issues/2221

@Rafael with the OSSN 6.6 it doesn't replace the file again if modified by cpanel but original ,htaccess file (only if you upgrade it)

https://github.com/opensource-socialnetwork/opensource-socialnetwork/issues/2179

German Michael Zülsdorff Replied 2 years ago

Hmm. just wondering ...
you wrote "The default PHP version on the server is 7.4."
So, how were you able to pass the version check on line 96 of classes/OssnInstall.php?
Maybe because comparing a string with a floating point value like

$phpversion = substr(PHP_VERSION, 0, 6);
if($phpversion >= 8.0) {

isn't really foolproof anyway. I think a more reliable way would be to use PHP's version_compare function.

Breton Rafael [redcrested.net] Replied 2 years ago

Solved. This error occurs because the install routine replaces .htaccess on each step. And my server has different configurations for each folder. The default PHP version on the server is 7.4.

Just an idea: Add some check on install to not overwrite .htaccess

Breton Rafael [redcrested.net] Replied 2 years ago

In an attempt to install a fresh OSSN, I got the same error. After enabling the display error on DB, I was able to see this message on the log

[23-Dec-2022 22:04:43 UTC] [#1671833083|8FFAE6320B8CE1651BDCB83893A462E4] ParseError: syntax error, unexpected '|', expecting ';' or '{' in /home/u592571552/domains/.../public_html/ossn/components/OssnPhotos/classes/OssnPhotos.php:236
Stack trace:
#0 /home/u592571552/domains/.../public_html/ossn/classes/OssnComponents.php(244): include_once()
#1 /home/u592571552/domains/.../public_html/ossn/libraries/ossn.lib.components.php(69): OssnComponents->loadComs()
#2 /home/u592571552/domains/.../public_html/ossn/system/start.php(39): include_once('/home/u59257155...')
#3 /home/u592571552/domains/.../public_html/ossn/installation/pages/account.php(12): require_once('/home/u59257155...')
#4 /home/u592571552/domains/.../public_html/ossn/installation/libraries/ossn.install.php(75): include('/home/u59257155...')
#5 /home/u592571552/domains/.../public_html/ossn/installation/libraries/ossn.install.php(151): ossn_installation_include('/home/u59257155...')
#6 /home/u592571552/domains/.../public_html/ossn/installation/index.php(34): ossn_installation_page()
#7 {main}

Line 236 of OssnPhotos/classes/OssnPhotos.php

    public function searchPhotos($params): array | bool {
            return $this->searchFiles($params);
    }

I downloaded the version available on the download page. PHP version is 8.1. In another domain on the same server, I run the 6.4 version without errors.

Could I have made an error?

Indonesian Arsalan Shah Replied 2 years ago

go to yourwebsite.com/installation?page=account