DennisSuitters / AuroraCMS

The Australian Open Source Content Management System
https://diemendesign.github.io/AuroraCMS/
MIT License
15 stars 2 forks source link

Can't install it on hosting server #8

Closed husambg closed 1 year ago

husambg commented 1 year ago

Hi, I have hosting plan with ds.network. using cpanel. php is 7.4 I start the installation, I enter the sql database name, user and password, then next at site url and administration folder , I enter the url of the site and url of the admin folder, when I click "Next", nothing happened. if I close the browser and try to open again. it say "This page isn’t working" error 500 Please assist Thank you Regards

Browser Firefox

php 7.4

Hosting server Linux, Kernel 3.10.0-962.3.2.lve1.5.27.el7.x86_64 with Apache

Database 10.5.19-MariaDB-cll-lve-log

DennisSuitters commented 1 year ago

I may need to run through the install process and make see if there's an issue.

Can you check if the core/config.ini file has been created? If you wish to try it again without having to wipe and upload everything again, you can rename or remove the core/config.ini file, and remove the database tables. It may also help to check the server log files, and check if the install process is trying to use functions that are now deprecated in PHP 7.4, as lately I've been working with PHP8.

Thanks for having a look at the project, and reporting issues.

husambg commented 1 year ago

Thank you for your reply, File core/config.ini created

[database]
prefix = aurora_
driver = mysql
host = localhost
port = 3306
schema = xxxxxxxxxx_aurora
username = xxxxxxxxxx_aurora
password = xxxxxxxxxxxxxxxxxxxx
[system]
devmode = 
version = 1686105804
url = /https://xxxxxxxxxx.com.au/app/AuroraCMS-master
admin = https://xxxxxxxxxx.com.au/app/AuroraCMS-master/admin/

The data base tables never created 0 bytes

I changed the PHP to 8.0 , still the same issue file created with the same values, and the database is 0 bytes, no tables created.

I appreciate your assistance.

DennisSuitters commented 1 year ago

Try removing the leading / from the url part. I see your running it inside a folder on your domain. You could try

url = app/AuroraCMS-master
admin = admin

The CMS resolves the URL itself. It also auto resolves whether the domain is using http: or https: It may also be possible that it won't run within a folder on a domain the way you're trying. I've only ever used it locally, where url = /AuroraCMS and admin = admin, where the CMS would be access like http://localhost/AuroraCMS/ So it looks to me, it's more of a folder access resolving issue, at least from what you've shown me.

husambg commented 1 year ago

Hi, I tried and didn't work

[database]
prefix = aurora_
driver = mysql
host = localhost
port = 3306
schema = xxxxxx_aurora
username = xxxxxx_aurora
password = xxxxxxxxxxxxxxx
[system]
devmode = 
version = 1686176125
url = /auroracmsmaster
admin = auroracmsadmin

I moved the folder to subfolder on the domain still the same issue creates the config.ini file , no database, website gets blank if refresh.

DennisSuitters commented 1 year ago

hm, I'll have to check the installer out.

You can manually create the database, if you use phpmyadmin are something similar, you can manually import the database. I usually leave a default login that I use locally when working on stuff. The login for the developer account is dev/dev (obviously, you want to update those on a live server, but it should allow you to login). Then manually edit the already created config.ini file with the relevant details, I think it's only the url and admin references you'll need to edit.

Just had another thought, it could also be the .htaccess file needing adjusting to allow using the CMS within a subfolder and not the default domain, so I'll check that while I"m at it. Also, check the folder/file permissions (I'm guessing you probably already have, I just mention it in case).

husambg commented 1 year ago

Still the same issue. I started to wonder if it is .htaccess or some missing modules of php which lead to blank page.

DennisSuitters commented 1 year ago

Did you modify the .htaccess to work with domains, I'm pretty sure the default is set to work localhost and not https.

You may need to check the apache2 log files (/var/log/apache2/error.log). If you could, would you mind letting me know if any functions come up as unavailable, then I can add checks for those during the install.

husambg commented 1 year ago

Hi, Honestly I don't know how to setup .htaccess to work with domain. I don't have access to apache2 error log from the host provider. so I setup a new virtual server with Debian11 php 8.1 and tried to install there. here is the error i find

[Thu Jun 08 13:41:46.242935 2023] [php:error] [pid 894309] [client 192.168.15.108:16746] PHP Fatal error:  Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'aurora.aurora_config' doesn't exist in /var/www/html/aurora/core/core.php:15\nStack trace:\n#0 /var/www/html/aurora/core/core.php(15): PDO->query()\n#1 /var/www/html/aurora/index.php(57): require('...')\n#2 {main}\n  thrown in /var/www/html/aurora/core/core.php on line 15
[Thu Jun 08 13:42:45.649071 2023] [php:error] [pid 894310] [client 192.168.15.108:16757] PHP Fatal error:  Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'aurora.aurora_config' doesn't exist in /var/www/html/aurora/core/core.php:15\nStack trace:\n#0 /var/www/html/aurora/core/core.php(15): PDO->query()\n#1 /var/www/html/aurora/index.php(57): require('...')\n#2 {main}\n  thrown in /var/www/html/aurora/core/core.php on line 15

The same error I receive either before or after adding sql tables manually using phpmyadmin Not sure if this related or not.

DennisSuitters commented 1 year ago

Try using this as your .htaccess


RewriteOptions inherit
# Uncomment this on a live site
#<IfModule mod_headers.c>
#    <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
#        Header set Cache-Control "max-age=604800, public"
#    </FilesMatch>
#</IfModule>
#Disable Directory Browsing
#Options All -Indexes
<IfModule mod_rewrite.c>
  SetEnv HTTP_MOD_REWRITE On
    RewriteEngine On
  Options +SymLinksIfOwnerMatch
  # Redirect HTTP with www to HTTPS without www
  RewriteCond %{HTTPS} off
  RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  RewriteRule .* https://%1%{REQUEST_URI} [R=301,L]
  # Redirect HTTP without www to HTTPS without www
  RewriteCond %{HTTPS} off
  RewriteCond %{HTTP_HOST} !^www\. [NC]
  RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  # Redirect HTTPS with www to HTTPS without www
  RewriteCond %{HTTPS} on
  RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  RewriteRule .* https://%1%{REQUEST_URI} [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*) index.php?url=$1 [L,QSA]
</IfModule>
# Block Access to .ini, .db, .sql, .htaccess Files
<FilesMatch "(^.*\.([Ii][Nn][Ii]|[Dd][Bb]|[Ss][Qq][Ll]|[Hh][Tt][Aa])|~)$">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

Also, it looks as though the database tables haven't been imported into the database.

Here's the config.ini file that was autogenerated for https://diemen.design/ Obviously, I've edited the credentials, but I think it's the url and admin options of most concern so they resolve correctly in the code.

[database]
prefix =
driver = mysql
host = localhost
port = 3306
schema = [database name]
username = [database password]
password = [password]
[system]
devmode =
version = 1627998274
url =
admin = admin

There's also an error.log file in media/cache/error.log, but that is more for when error reporting is turned off on a production server, to be able to catch critical errors that may not be reported, but help with debugging.

husambg commented 1 year ago

Hi, Thank you for your time. I tried XAMPP on windows to setup AuroraCMS please find the error log

[Tue Jun 13 21:01:16.651290 2023] [:error] [pid 11728:tid 1908] [client 127.0.0.1:52023] PHP Fatal error:  Uncaught exception 'PDOException' 
with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'aurora.aurora_config' doesn't exist' in C:\\xampp\\htdocs\\aurora\\core\\core.php:15\nStack trace:\n#0
C:\\xampp\\htdocs\\aurora\\core\\core.php(15): PDO->query('SELECT * FROM
`...')\n#1 C:\\xampp\\htdocs\\aurora\\index.php(57): 
require('C:\\\\xampp\\\\htdocs...')\n#2 {main}\n  thrown in C:\\xampp\\htdocs\\aurora\\core\\core.php on line 15 [Tue Jun 13 21:01:19.015969 2023] [:error] [pid 11728:tid 1908] [client 127.0.0.1:52025] PHP Fatal error:  Uncaught exception 'PDOException' 
with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'aurora.aurora_config' doesn't exist' in C:\\xampp\\htdocs\\aurora\\core\\core.php:15\nStack trace:\n#0
C:\\xampp\\htdocs\\aurora\\core\\core.php(15): PDO->query('SELECT * FROM
`...')\n#1 C:\\xampp\\htdocs\\aurora\\index.php(57): 
require('C:\\\\xampp\\\\htdocs...')\n#2 {main}\n  thrown in C:\\xampp\\htdocs\\aurora\\core\\core.php on line 15 [Tue Jun 13 21:02:03.888311 2023] [:error] [pid 11728:tid 1908] [client 127.0.0.1:52027] PHP Fatal error:  Uncaught exception 'PDOException' 
with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'aurora.aurora_config' doesn't exist' in C:\\xampp\\htdocs\\aurora\\core\\core.php:15\nStack trace:\n#0
C:\\xampp\\htdocs\\aurora\\core\\core.php(15): PDO->query('SELECT * FROM
`...')\n#1 C:\\xampp\\htdocs\\aurora\\index.php(57): 
require('C:\\\\xampp\\\\htdocs...')\n#2 {main}\n  thrown in C:\\xampp\\htdocs\\aurora\\core\\core.php on line 15
DennisSuitters commented 1 year ago

The log file is showing that the database tables don't exist.

If you're trying to run the installer, check that core/config.ing doesn't exist, you can simply delete it.

If you have run the installer and got to where it says everything worked, have you checked that the database does in fact exist, using phpmyadmin or another database admin tool to do so?

If the database exists, and the config.ini file was written correctly, you can change the database credentials directly by editing the relevant options in the config.ini file.

I just installed another instance here on my local machine without any issues (I use Linux so it behaves the same as the hosting space I currently use with VentraIP). I checked the log files in /var/log/apache2/error.log as well as [site folder]/media/cache/error.log with nothing shown.

husambg commented 1 year ago

Hi Diemen. I create the database using phpmyadmin Then run the installer I enter the details in the first page ( database name , username and password) > Next I enter the domain url and admin folder > Next the page flash and stay on the same page.

Here the issue Database still empty. config.ini created with the correct details if I want to start again , it will give me blank page.

tested with xampp for windows , php7.4 php8.0, Rockylinux, and Hosting provider , exactly the same issue.

Will you please advise which linux distro are you using ?

DennisSuitters commented 1 year ago

If you want to start the installation again, you'll need to rename or remove the core/config.ini file. That's how the installer starts, if it doesn't exist then the installer page is what gets displayed to allow installation.

I'm using Linux Mint (Debian Based) on my local machine. PHP 8.2.7. The server uses Linux (Not sure which as cPanel doesn't show that, just that it's Linux) => Apache 2.4.57, Database 10.6.14-MariaDB.

The log file you showed me, indicates that the database tables haven't been created. You can if you wish import the core/AuroraCMS.sql file into the database, the login will be dev/dev (which I leave for this reason). I'm confused as to why it looks as though (in your case) the database isn't being imported during the installation. It could be something with the differences in our different setups, and will need adjusting. I may have to spin up a virtual machine and XAMP/WAMP to try out at least as close to your setup as I can.

DennisSuitters commented 1 year ago

Ok, I worked it out. Not sure why I didn't actually open the installed site after running the installer, but if I had I would have realised I was looking at the wrong database, lol, sorry, my bad. Anywho, I not only fixed (importing the database credentials in the wrong spot, not sure why that moved, or I hadn't picked up on it before), I also improved some of the interface like the page-blocking when the system is busy, such as importing the database (Happens when submitting step 2, as those details are required for the import). The included .zip file should (fingers crossed) fix the import issue, the files are in the folders where they are required, and will be included in the next update. install-fixes.zip

husambg commented 1 year ago

Hi, I am really sorry but still the same.

But if I manually adjust the config file and install the database, then I can open admin login page, but login with username and password dev/dev not working, and the website will come with message "A Website Theme has not been set."

Thank you

DennisSuitters commented 1 year ago

Did you download the zip and replace the files, then rerun the install?

If you check the database, remove the data from the login table, and use the below (you may need to add the prefix info before the login table name):

INSERT INTO `login` (`id`, `options`, `theme`, `bio`, `bio_options`, `username`, `password`, `tags`, `cover`, `coverURL`, `attributionImageTitle`, `attributionImageName`, `attributionImageURL`, `avatar`, `gravatar`, `business`, `name`, `email`, `www`, `experience`, `hash`, `emailPassword`, `email_check`, `liveChatNotification`, `email_signature`, `url`, `address`, `suburb`, `city`, `state`, `postcode`, `country`, `abn`, `phone`, `mobile`, `caption`, `seoDescription`, `notes`, `resume_notes`, `status`, `active`, `helpResponder`, `activate`, `newsletter`, `language`, `timezone`, `rank`, `discount`, `spent`, `points`, `purchaseLimit`, `purchaseTime`, `infoHash`, `hostCost`, `siteCost`, `hostStatus`, `siteStatus`, `lti`, `hti`, `sti`, `accountsContact`, `userAgent`, `userIP`, `pti`, `ord`, `ti`) VALUES
(1, '11111111111111111110011111111111', 'dark', 0, '11110000000000000000000000000000', 'dev', '$2y$10$0a6.DXxLRWPMc6zOm3jaXebFwkE0MUiVPfJuCx.5lh2PaJXbfdNJW', '', NULL, '', '', '', '', 'avatar_1.jpg', '', '', '', '', '', 0, '7d012f1b1b511f330e7766e016794422', '', 0, 0, '', '', '', '', '', '', 0, '', '', '', '', 'Example Bio Caption', '', '<p>Example Bio Notes</p>', '', '', 1, 0, '', 0, 'en-AU', 'default', 1000, '', 0, 0, '', 0, '7d012f1b1b511f330e7766e016794422', '0.00', '0.00', 'paid', 'paid', 1686755139, 1635515811, 1634201565, 0, '', '127.0.0.1', 1674487994, 1, 1627998291);

That's the account information from my localhost settings. It should at least allow you to login. The front end stating a theme hasn't been set is normal, as the theme hasn't been set, you can do that in admin under preferences/theme.

husambg commented 1 year ago

I downloaded the zip file, replaced files inside with the zip. The same issue.

But the login worked and now I can access the admin. and changed the theme, it is working now.

I can start testing the CMS now, Hope I can create theme for it and do the job for me. Thank you for the support.

DennisSuitters commented 1 year ago

No worries, thanks for reporting issues. Hopefully, you can work out how themes work. They're basically HTML with extra markup style placeholders. I need to do video tutorials at some point, along with text explanations of building themes.

I'm still not sure why you're having installation issues, I'll set up a virtual machine on my machine with Windows and XAMP and see how it behaves, 'cos it is something that needs to work out of the box.

husambg commented 1 year ago

Thank you, If you can make some documentation for creating the theme, it will be wonderful. The CMS is good, and if we can modify the theme easily and use bootstrap ( because of mobile devices ) it will be great. Thank you again.