(07-25-2023, 04:20 AM)spreaderman Wrote: I do not know what I am doing wrong but for 2 days I have been trying to install Ci4. It is very stange as I have a perfectly running CI4 4.1.9 and replicated everything for a new domain but is just dies with 500 error:
Apache2 on unbuntu config
Code:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName www.example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/public_html/public
ErrorLog ${APACHE_LOG_DIR}/example.com.error.log
CustomLog ${APACHE_LOG_DIR}/example.com.access.log combined
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
I moved env to .env and changed
Code:
CI_ENVIRONMENT = development
app.baseURL = 'https://www.example.com'
My .htaccess file is in /public and as follows;
Code:
#AuthType Basic
#AuthName "My Protected Area"
#AuthUserFile /var/www/.htpasswd
#Require valid-user
# Disable directory browsing
Options All -Indexes
# ----------------------------------------------------------------------
# Rewrite engine
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and features.
# FollowSymLinks must be enabled for this to work.
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
# If you installed CodeIgniter in a subfolder, you will need to
# change the following line to match the subfolder you need.
# http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
# RewriteBase /
# Redirect Trailing Slashes...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Rewrite "www.example.com -> example.com"
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
# Checks to see if the user is attempting to access a valid file,
# such as an image or css document, if this isn't true it sends the
# request to the front controller, index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA]
# Ensure Authorization header is passed along
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
ErrorDocument 404 index.php
</IfModule>
# Disable server signature start
ServerSignature Off
# Disable server signature end
Here are my trouble shooting steps:
- yes, restarted apache2
- If I put in a phpinfo.php and go to www.example.com/phpinfo.php it works
- tried the htaccess from the github reposiory. The only diff is my htpasswd header which I have of course disabled.
- checked the user of apache and chwon'ed it to sudo chown -R www-data:www-data /var/www/ just in case
- /writable is writable
Any pointer super appreciated. I originally used CI a lot but move to wordpress. Wordpress is quite robust but it is very slow because of that. Back to Ci4 as it is blazingly faster. I love the new SHEILD and SETTINGS which I can't wait to try out.
Regards
To fix this, i was able to see in the apache log files that it was complaining about the version of composer I had. I did composer self-update and reinstalled. It works.