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
952 stars 574 forks source link

HTTP ERROR 500** (the website doesn't load with main page or page /admin123) #1033

Open user14983 opened 2 years ago

user14983 commented 2 years ago

Hello,

I installed (manually with .../"_install") but after removing the "_install" folder I try to go on the website but it doesn't work...

the website doesn't load with main page or page /admin123

error message in chrome : **This page isn’t working *** is currently unable to handle this request. HTTP ERROR 500

can you let me know why so ? what is the problem I have with the website ? I would like the page to load and use the website, can you help me ?

thanks for your help, regards

coolyou11 commented 2 years ago

You won't get any help on here with any 500 Error

rondlite commented 2 years ago

if /admin123 is not loading (404).. it's mod_rewrite not enabled.

https://ph7builder.com/doc/en/how-to-install-rewrite-module

user14983 commented 2 years ago

Hello,

thanks but i didn't help, the problem remain the same :-(

Can Someone Help me Please ?

rondlite commented 2 years ago

so then /admin123 also gives a 500 error and not a 404

check in _protected/framework/log if there is anything to give a clue, for me it had gzip there, which was the cause for my 500

user14983 commented 2 years ago

no "...//framework/log"

"data/log/pH7log/except/gzip" is existing

but i don't understand what I'm supposed to do to make this can work properly

Can Someone Help me Please ?

user14983 commented 2 years ago

Can Someone Help me Please ?

user14983 commented 2 years ago

Hi, I've installed pH7 on my hosting server twice and the installation completes each time, but the website never loads after initial installation. Just getting the generic Error 500 - The website cannot handle the request. The same error while trying to load the /admin123 page. I didn't use softaculous, but instead FTP'd the files to my server and set all chmod permissions as indicated in the instructions. If I put the _install folder back in place (or don't delete it at all), the page loads and recognizes that it is there and wants me to delete it. As soon as I delete it, back to the Error 500. I can't find any log files that would tell me where to start. Any help or suggestions?

coolyou11 commented 2 years ago

You won`t get any help on here with this Error I had the same problems but no help. I would find a better script, The guy that made this script is not interested in helping.

user14983 commented 2 years ago

Can Someone Help me Please ?

peter1145 commented 1 year ago

report this script to softaculous and get this script removed off Softaculous .

roland1509 commented 1 year ago

You are getting this error because you dont have Apache installed and configure on your machine or if Apache is installed then it might be that the service is not started. Work on this and your Scripts will work well.

ip6li commented 1 year ago

I got this error because https used a certificate w/o proper attributes (DNS or IP). Using a Let's Encrypt certificate with matching DNS SAN Attributed solved problem. PH7 does not log details regarding such problems, using php.ini development version enabled logging of such errors.

dac2020 commented 1 year ago

I definitely have Apache24 running and working correctly along with php 82 and using a proper letsencrypt cert. All of the requirements were met and the installer runs. However, there is a missing asset/gzip directory structure or the installer is not correctly setting things up.

I see no replies to issues so cannot really tell if this is an active project or not.

Maybe it doesn't like php82.

` No gzip directory was created on install and none seems to exist in the code. This is the only 'asset' directory I can find.

$ ls -la _protected/app/system/core/assets/ total 12 drwxr-xr-x 7 www www 7 Aug 2 19:21 . drwxr-xr-x 6 www www 6 Aug 2 19:21 .. drwxr-xr-x 3 www www 9 Aug 2 19:21 ajax drwxr-xr-x 5 www www 5 Aug 2 19:21 cron drwxr-xr-x 2 www www 4 Aug 2 19:21 css drwxr-xr-x 2 www www 4 Aug 2 19:21 file drwxr-xr-x 2 www www 4 Aug 2 19:21 js `

Example domain name, 1.com.

`GET https://www.1.com/asset/gzip/?t=js&d=static/js/&f=jquery/box.js,jquery/tipTip.js,bootstrap.js,common.js,str.js,holder.js [HTTP/1 500 Internal Server Error 150513ms]

GET https://www.1.com/asset/gzip/?t=js&d=static/js/&f=jquery/box.js,jquery/tipTip.js,bootstrap.js,common.js,str.js,holder.js Status 500 Internal Server Error VersionHTTP/1 Transferred505 B (0 B size) Referrer Policystrict-origin-when-cross-origin

Cache-Control
    no-cache, must-revalidate
Connection
    close
Content-Encoding
    gzip
Content-Length
    20
Content-Type
    text/javascript;charset=UTF-8
Date
    Thu, 03 Aug 2023 15:13:24 GMT
Expires
    Sun, 13 Aug 2023 15:14:39 GMT
Pragma
    public
Server
    Apache/2.4.57 (FreeBSD) OpenSSL/1.1.1o-freebsd
Vary
    Accept-Encoding,User-Agent
X-Content-Encoded-By
    pH7Builder - Web Engineer, Pierre-Henry Soria 18.0.0 Build 1
X-Powered-By
    pH7Builder.com

Accept
    */*
Accept-Encoding
    gzip, deflate, br
Accept-Language
    en-US,en;q=0.5
Connection
    keep-alive
Cookie
    PHS7SESS=uom7a6n4ftvca4go1pgt2s432f
Host
    www.1.com
Referer
    https://www.1.com/
Sec-Fetch-Dest
    script
Sec-Fetch-Mode
    no-cors
Sec-Fetch-Site
    same-origin
User-Agent
    Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0

`

ip6li commented 1 year ago

For now I do some experiments with pH7 and Docker. Currently I got a successful set up with following dockerfile. Please consider this is still highly experimental, e.g. some ARG parameters are not used yet.

from php:8.1-apache

ARG hostname=ph7
ARG domain=example.com
ARG fqname=${hostname}.${domain}

ARG MYSQL_HOST
ARG MYSQL_USER
ARG MYSQL_PASSWORD
ARG MYSQL_DB

run DEBIAN_FRONTEND=noninteractive apt-get update
run DEBIAN_FRONTEND=noninteractive apt-get install -q -y apt-utils
run DEBIAN_FRONTEND=noninteractive apt-get install -q -y \
  locales

RUN sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
    locale-gen
ENV LANG de_DE.UTF-8
ENV LANGUAGE de_DE:de
ENV LC_ALL de_DE.UTF-8

run DEBIAN_FRONTEND=noninteractive apt update && apt -q -y full-upgrade

# Install Postfix.
run echo "postfix postfix/main_mailer_type string Internet site" > preseed.txt
run echo "postfix postfix/mailname string ${fqname}" >> preseed.txt
# Use Mailbox format.
run debconf-set-selections preseed.txt
run DEBIAN_FRONTEND=noninteractive apt-get install -q -y \
  postfix \
  libsasl2-modules
run rm -rf /etc/postfix

run DEBIAN_FRONTEND=noninteractive apt-get install -q -y \
  procps \
  cron \
  curl

run DEBIAN_FRONTEND=noninteractive apt-get install -q -y \
  gettext ffmpeg libbz2-dev zlib1g-dev libpng-dev libgd-dev libzip-dev libexif-dev

RUN \
    docker-php-ext-install bz2 && \
    docker-php-ext-configure gd --with-freetype --with-jpeg && \
    docker-php-ext-install gd && \
    docker-php-ext-install iconv && \
    docker-php-ext-install opcache && \
    docker-php-ext-install pdo && \
    docker-php-ext-install pdo_mysql && \
    docker-php-ext-install exif && \
    docker-php-ext-install zip

RUN \
  pear install Net_DNS2

RUN curl -sS https://getcomposer.org/installer | php \
    && mv composer.phar /usr/local/bin/ \
    && ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
ENV PATH="~/.composer/vendor/bin:./vendor/bin:${PATH}"

run \
  rm -rf /var/www/html \
  && mkdir -p /var/www/html \
  && chown -R www-data:www-data /var/www

COPY ./000-default.conf /etc/apache2/sites-available/000-default.conf
COPY ./default-ssl.conf /etc/apache2/sites-available/default-ssl.conf
COPY ./php-custom.ini /usr/local/etc/php/conf.d/php-custom.ini

RUN cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
#RUN cp "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

RUN \
  rm -f /etc/apache2/sites-enabled/000-default.conf \
  && ln -s /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-enabled/000-default-ssl.conf \
  && a2enmod ssl \
  && a2enmod rewrite

COPY ./entrypoint.sh /root/entrypoint.sh
RUN chmod 700 /root/entrypoint.sh
ENTRYPOINT [ "/root/entrypoint.sh" ]

Postfix is installed because PHP and smtp is really strange w/o more PHP libraries.

entrypoint.sh has following content:

#!/usr/bin/env bash

/usr/sbin/cron

cd /etc/postfix || exit 1
for i in generic relay_domains sasl_passwd transport virtual; do
  postmap $i
done

/usr/sbin/postfix start-fg &

if [ ! -f /var/www/html/composer.json ]; then
  cd /var/www \
    && composer create-project ph7software/ph7builder --prefer-dist /var/www/html \
    && chown -R www-data:www-data /var/www

  for i in de_DE es_ES fr_CA fr_FR he_IL id_ID it_IT nl_NL pt_BR; do
    ln -s /var/www/langs/${i} /var/www/html/_protected/app/langs/${i}
  done
fi

/usr/sbin/apache2ctl -D FOREGROUND

docker-compose.yml:

version: '3.7'

services:
  ph7:
    hostname: ph7
    build:
      context: .
    environment:
      - MYSQL_HOST
      - MYSQL_USER
      - MYSQL_PASSWORD
      - MYSQL_DB
    ports:
      - 172.20.0.1:8083:80
      - 172.20.0.1:8084:443
    volumes:
      - ./postfix:/etc/postfix:cached
      - ./www:/var/www:cached
      - ./pH7-Internationalization/_protected/app/langs/de_DE:/var/www/langs/de_DE:cached
      - ./pH7-Internationalization/_protected/app/langs/es_ES:/var/www/langs/es_ES:cached
      - ./pH7-Internationalization/_protected/app/langs/fr_CA:/var/www/langs/fr_CA:cached
      - ./pH7-Internationalization/_protected/app/langs/fr_FR:/var/www/langs/fr_FR:cached
      - ./pH7-Internationalization/_protected/app/langs/he_IL:/var/www/langs/he_IL:cached
      - ./pH7-Internationalization/_protected/app/langs/id_ID:/var/www/langs/id_ID:cached
      - ./pH7-Internationalization/_protected/app/langs/it_IT:/var/www/langs/it_IT:cached
      - ./pH7-Internationalization/_protected/app/langs/nl_NL:/var/www/langs/nl_NL:cached
      - ./pH7-Internationalization/_protected/app/langs/pt_BR:/var/www/langs/pt_BR:cached
    extra_hosts:
      - "mysql:172.20.0.1"
    logging:
      driver: json-file

php-custom.ini:

post_max_size = 128M
upload_max_filesize = 128M

With those files I got a running pH7 instance.

ip6li commented 1 year ago

pH7 is an Open Source project and developers are providing this software for free. Feel free to ask them for paid professional support. For now I consider to fork this project to modify it for a high load environment. This means:

ip6li commented 1 year ago

I created a copy of this repository on Gitlab, because Gitlab has a better support of my CI/CD pipeline. My tests ran also in several problems, bencause pH7-Social-Dating-CMS suffers on some scalability problems. Most user transactions requires MySQL operations. Neither SQL nor filesystem storage will be able to handle millions of customers.

Automated tests reported some security related issues which I have to investigate.

First step is to replace logon process by OpenID, which works very well in cloud environments.

Step two is to replace filesystem and SQL storage of blob objects by Redis.

Next step to set up a docker swarm configuration to test which provides a MariaDB cluster, a Redis cluster, Keycloak and of course this application. From that point a Kubernetes migration should be possible. From that stage on I will test it on AWS EKS.

PHP code looks quite good, it follows mostly clean code principles, so it should be possible to migrate it to modern cloud architectures.

dac2020 commented 1 year ago

Scalability can be done using many servers and load balancing so long as session info is in the db. Each server should be able to handle dozens to hundreds of users assuming most users aren't doing heavy load things. In other words, it doesn't take all that much to make an app highly scalable. I would never use something like docker, I would dedicate separate physical servers as scalability so it would be nice to have something that's easy to replicate.

Is OpenID private? For folks that want adult sites or private (for what ever reason) would not want unified logins and some operators might not either. If it's just an option, that would be good.

Not everyone wants cloud solutions. I know for sure that everyone I know prefers hosting on their own resources, they do not want to count of the 'cloud' :).

Is this something you are actively doing now and on your own?

ip6li commented 1 year ago

Scalability is not primary business of SQL databases, they are good in transaction safety, but not in scalability. NoSQL databases are mostly not so good in transaction safety but very good in scalability, even with millions of users. My pH7-Social-Dating-CMS will not support non container installations.

Regarding system design I am always depend on container platforms, Docker for development, Kubernetes for production. Keyword is "dependency hell": Containers are using well defined images with a minimal set of dependencies which matches perfectly to applications requirements. This pays off especially regarding PHP which have a lot of dependencies to very specific versions of shared libraries.

OpenID is a well acknowledged authn/authz protocol. You can run your own OpenID server (e.g. Keycloak) or use a public cloud service like Google. It is your decision what are you using here.

A cloud solution can be private or public. Docker and Kubernetes can be operated on your own Debian/Ubuntu servers or you are using e.g. Amazon AWS. It is your decision what are you using here, again. Maybe a hybrid solution is a good choice to handle load peaks. A distributed database solution is mandatory for such architectures, with SQL you may run in really nasty problems.

For tests I am running a plain vanilla pH7-Social-Dating-CMS including pH7-Internationalization to find out, what the best PHP/Docker environment matches this application. It is also a test environment for Cloudflare. Author of pH7-Social-Dating-CMS recommends PHP 8.1 according to included code and documentation, but I want to check out PHP 8.2, because this is the official version included in Debian 12 package repository.

My own pH7-Social-Dating-CMS repository at Gitlab is under development for OpenID support. I will include a docker-compose.yml which installs following components:

If OpenID feature of pH7-Social-Dating-CMS reaches an usable state I will ask author Pierre-Henry for a pull request. Let's see what happens then.

dac2020 commented 1 year ago

I agree that DB scalability would be nice to have if it's something you don't have to think about that much. One nice point about using docker is that your support time should be lowered too.

Let me know where this new version will be and I'll keep an eye on your progress. If you can use another test site, I could do that too.

I wrote to Pierre and no answer. I really wanted to give this a try to see how it can work out for a larger project.

ip6li commented 1 year ago

Maybe Pierre is on vacation? For further development I set up a Docker environment, see pH7-Social-Dating-CMS-Docker.

dac2020 commented 1 year ago

I found an issue that stated this is not 8.2 ready. I downgraded to 8.1 with the same results then to 8.0 with the same results. Always the missing gzip; /asset/gzip/?t=js&d=static/js/&f=lang/en.js HTTP/1.1" 500

and PHP Warning: Unknown: function "1" not found or invalid function name in Unknown on line 0

dac2020 commented 1 year ago

I wish I could find help with this instead of having to give up and find something else. It seems promising but lacking help.