pH7Software / pH7-Social-Dating-CMS

😻 pH7Builder (formerly pH7CMS) is a Professional & Open Source Social Dating CMS written in PHP 8 🚀 This Social Dating Script aims to be low resource-intensive, powerful and secure. pH7Builder includes over 40 modules. It is the first Professional, Free & Open Source Social Dating Site Builder Software and the first choice for enterprise level Da
https://pH7Builder.com
MIT License
957 stars 573 forks source link

Can not log in to admin control panel #682

Closed Usalabs closed 4 years ago

Usalabs commented 4 years ago

I've been trying for 2 weeks to get ph7cms to work properly, I don't know what system the dev's used to get it working, but it doesn't work on my Ubuntu 18.04 LTS headless server running Apache, Mysql and PHP 7.2.

The problem is the admin control panel, every time I try to login with the right user details, I get redirected back to the admin login page, no errors, nothing in the logs, and nothing shown in development mode.

ATM, I'm only testing ph7cms on a test server to make sure it works properly, before being installed on a production server.

The URL to test it is:- http://saundcom-dating.no-ip.org/dating note that I'm using a non standard HTTP port and using a DYNDNS service with port redirection, because my ISP blocks incoming on ports 80 and 443 (not that I'll be using SSL, as I don't have an SSL certificate yet).

Undefined-Variables commented 4 years ago

I use Ubuntu 18.04 LTS, PHP7.2, MariaDB and also use Apache2.4 and all works.

Does it allow you to login as a normal user?

Usalabs commented 4 years ago

Nope, I can't even create a new user, I just get redirected back to the main home page

Undefined-Variables commented 4 years ago

Try using another browser like Firefox, Chrome etc. Sounds like a problem creating a session to me!

Usalabs commented 4 years ago

I did, I have Opera, Firefox, Chrome, and Edge, I tried all of them and even completely cleaned out everything from cookies to browsing history and nothing.

As I'm only using a test server, I have created a new install and if anyone wants to try and login to the admin section, use these credentials, (I can easily re-install the site later):-

LoginEmail = nobody@nowhere.com UserName = admin Paswword = A1234567890

Url = http://saundcom-dating.no-ip.org/dating/admin123

The site is in development mode.

Undefined-Variables commented 4 years ago

HTTP/1.1 301 Moved Permanently Date: Sat, 07 Dec 2019 12:27:57 GMT Server: Apache/2.4.29 (Ubuntu) Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate Pragma: no-cache X-Powered-By: pH7CMS.com X-Content-Encoded-By: pH7CMS - Web Engineer: Pierre-Henry Soria 15.2.0 Build 1 Set-Cookie: PHS7SESS=53p7tq0mffjmcr31q6e4ku0j32; expires=Sat, 07-Dec-2019 15:27:57 GMT; Max-Age=10800; path=/; domain=.24.255.38.78:14080; HttpOnly Set-Cookie: PHS7SESS=g7pmujkf8ihr38aks6clmm7jih; expires=Sat, 07-Dec-2019 15:27:57 GMT; Max-Age=10800; path=/; domain=.24.255.38.78:14080; HttpOnly Location: http://24.255.38.78:14080/dating/admin123/main/login Vary: Accept-Encoding Content-Length: 13287 Connection: close Content-Type: text/html; charset=UTF-8

You are trying to set a cookie to .24.255.38.78:14080;

Change the cookie settings in _protected/app/configs/config.ini and use the URL not the IP address as many browsers wont set a cookie to an IP address.

Usalabs commented 4 years ago

there is no IP address in the config.ini cookie settings, just this PHP7_DOMAIN_COOKIE on the line:-

domain = PHP7_DOMAIN_COOKIE

Undefined-Variables commented 4 years ago

Change it to

domain = "saundcom-dating.no-ip.org/dating/"
Usalabs commented 4 years ago

I just did and I still got the same results

Undefined-Variables commented 4 years ago

copy and paste that file here!

Usalabs commented 4 years ago

`; ; Title: Config file of pH7 Dating Social Community CMS ; ; Author: Pierre-Henry Soria hello@ph7cms.com ; Copyright: (c) 2011-2019, Pierre-Henry Soria. All Rights Reserved. ; License: GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory. ; Link: http://ph7cms.com ; ;

[application] ; Default theme (do not change!) default_theme = base

; Do not change! This is the language of the internal system default default_lang = "en_US"

[mode] ; 'production' or 'development' environment = development

[software] name = "¡pH7! Social Dating CMS" type = Core author = "Pierre-Henry Soria" company = "pH7CMS (Pierre-Henry Soria)" copyright = "Pierre-Henry Soria, All Rights Reserved." license = "GNU GPL v3" website = "http://ph7cms.com" email = "hello@ph7cms.com"

[database] type_name = MySQL type = mysql hostname = "localhost" username = "saundcom" password = "?????????" name = "apachedating" prefix = "ph7" charset = "utf8mb4" port = 3306

[validate] phone.pattern = "(+|00)?[0-9]{1,3}[0-9]{5,14}(x.+)?"

[video] ; Max video size. e.g.,15K, 100M, 4G upload.max_size = 500M

; FFmpeg path. e.g., Unix: /usr/bin/ffmpeg Windows: C:\ffmpeg\ffmpeg.exe handle.ffmpeg_path = "/usr/bin/ffmpeg"

[cookie] ; If you have multiple sites with this CMS on the same domain, the prefix is used to avoid the collision between the same cookie prefix = "pH7164ae_"

; 31536000 seconds = 1 year expiration = 31536000 path = "/"

; Cookie domain, for example 'yoursite.com'. ; To make cookies visible on all subdomains then the domain must be prefixed with a dot like '.yoursite.com' ; domain = PH7_DOMAIN_COOKIE domain = saundcom-dating.no-ip.org/dating/

[session] prefix = "pH7164ae_"

; WARNING The session name can't consist of digits only, at least one letter must be present. ; Otherwise a new session id is generated every time. ; e.g., PHPSESSID cookie_name = "PHS7SESS"

; 10800 seconds = 3 hours expiration = 10800 path = "/"

; Session Cookie domain, for example 'yoursite.com'. ; To make cookies visible on all subdomains then the domain must be prefixed with a dot like '.yoursite.com' ; domain = PH7_DOMAIN_COOKIE domain = saundcom-dating.no-ip.org

[cache] ; General cache, usually for database contents, but may also involve other data enable.general.cache = 1

; Caching for HTML contents from template files enable.html.tpl.cache = 1

; Caching for JavaScript and CSS files, It's very important to activate it if you use the compressor code, but you must disable it when you are in developing mode enable.static.cache = 1

; Minify the code for CSS, HTML, PHP and JavaScript (also minify dynamically the code like Geo Maps code) enable.static.minify = 1

; Gzip compression for JavaScript, CSS and other static files enable.static.gzip_compress = 1

; base64 encode for images if file-size is lower than 24KB enable.static.data_uri = 0

; Enable or Disabled Google Closure Compiler Service (https://closure-compiler.appspot.com )for the JS files. If you use for too many files at the same time, Google might break it. enable.js.closure_compiler_service = 0

; Enable or Disabled the compressor with Java ; (Requires Java installed on your server! This option is usually available on dedicated servers, sometimes on shared hosting. Please contact your hosting company for knowledge) enable.static.minify_java_compiler = 0

[ph7cms.api] ; Never change the pH7CMS API key (and never share it)!! This key is like a password. Each pH7CMS installation has a different one. ; The key is used for external apps, like iOS/Android apps, external app websites, etc. private_key = "99aae08915ef710bbc4bd722b8922319d1350705"

; Domains that can use the API allow_domains[] = "ph7cms.com" allow_domains[] = "your-domain-name.com"

[logging] log_level = 100 bug_report_email = "none@nowhere.com"

; 'file', 'database' or 'email' log_handler = file `

Undefined-Variables commented 4 years ago

; Cookie domain, for example 'yoursite.com'. ; To make cookies visible on all subdomains then the domain must be prefixed with a dot like '.yoursite.com' ; domain = PH7_DOMAIN_COOKIE domain = "saundcom-dating.no-ip.org/dating/"

[session] prefix = "pH7164ae_"

; WARNING The session name can't consist of digits only, at least one letter must be present. ; Otherwise a new session id is generated every time. ; e.g., PHPSESSID cookie_name = "PHS7SESS"

; 10800 seconds = 3 hours expiration = 10800 path = "/"

; Session Cookie domain, for example 'yoursite.com'. ; To make cookies visible on all subdomains then the domain must be prefixed with a dot like '.yoursite.com' ; domain = PH7_DOMAIN_COOKIE domain = "saundcom-dating.no-ip.org"

Undefined-Variables commented 4 years ago

The domain needs "" around it.

Usalabs commented 4 years ago

nope, still no go

Usalabs commented 4 years ago

I've even set the php error to display_all and write to /var/log/php.log but nothing even shows in the log which is empty, and nothing displayed with php errors set to display_all

Undefined-Variables commented 4 years ago

Your site is using the IP address and not the URL this is the problem. Try installing it again but use

http://saundcom-dating.no-ip.org/dating 

When you set it up not the IP address

Usalabs commented 4 years ago

The address is a DYNDNS service that uses port redirection, because my ISP blocks ports 80 and 443 on incoming.

Usalabs commented 4 years ago

If I remember it doesn't ask for any URL or IP addresses during setup

Undefined-Variables commented 4 years ago

This is your issue. Set it up on a server with static IP address. DYNDNS is your issue.

Usalabs commented 4 years ago

my home server uses a static LAN IP, as it's behind a NAT firewall.

I did try installing it, then using the WAN IP, and I even tried the direct LAN IP of the server and it's still the same

Usalabs commented 4 years ago

oh, and I even tried under windows 10 running XAMPP and it did the same thing, but other php scripts like E107, and PHPFusion work as they should

Undefined-Variables commented 4 years ago

You need a server with static WAN IP (Public IP)

The internal ip has nothing to do with your problems.

Usalabs commented 4 years ago

Hmmm, so basically you're saying ph7CMS is only designed to work on a WAN IP server? While other php scripts such as E107, PhPFusion, Concrete5, Bitweaver and many others work as they should, it's only ph7cms that I'm having the problems with.

Undefined-Variables commented 4 years ago

What I am saying is pH7cms is designed and written to be hosted on a server with a static IP address.

Usalabs commented 4 years ago

It looks like I'll need to remove it from the server and use something else,,, thanks for your help, I'll set this issue as closed.

Undefined-Variables commented 4 years ago

I ran a few tests regarding this issue, you need to install it using the url not the IP. So when you install it you need to go to

http://your-domain.com/install/

and not

http://192.168.0.1/install/ 

This solves your problem!

lock[bot] commented 4 years ago

Hi there, I locked the thread since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Thank you, Pierre-Henry Soria 🤖