1

I've been Googling around all day looking for answers to this, but I'm actually stuck.

Ok, so basically I installed Craft 3 via Composer into a subdomain on my development server (apache). Everything ran successfully, there are no error logs, and the database has been populated with all of the tables. The problem is that if I go to http://craft.domain.com/index.php?p=admin (or /index/admin or /admin or /) all I get is a 500 Internal server error, and not one with the fancy craft background either. It does say email [email protected]... on the error screen so I know SOMETHING's clicking, but I can't work my way around this.

I tried installing Craft once before manually by extracting the zip, uploading all the files, and then changing the .env file, and I got a similar result. I still wasn't able to access the admin OR the install page, and that's why I ended up trying it all through Composer instead.

Running the latest version of Apache, PHP 7, MYSQL with InnoDB; I run a ton of wordpress and laravel sites on this server without issue so I'm not clear on what makes Craft so different. I have WHM and shell access. Open to all suggestions.

Directory structure looks like this:

/home/username/public_html/craft (this is also the subdomain path)
  - config
  - modules
  - storage
  - templates
  - vendor
  - web
  - (and then the composer/env files)

Directory permissions are 775, the rest of the files are default Craft 3 installation. I've also made sure my PHP 7 memory limit is at 128MB (it was set to 32MB for some reason). Thank you for any advice in advance!

10
  • I'm assuming your web server points to /home/username/public_html/craft/web ?
    – Jalen Davenport
    Apr 9, 2018 at 23:52
  • No just /home/username/public_html/craft. Does it need to point to web? Apr 10, 2018 at 1:09
  • Yes, I'm pretty sure it does. Try it out and let me know how it goes... If it turns out to be the solution let me know so I can add it as an answer below.
    – Jalen Davenport
    Apr 10, 2018 at 1:10
  • No good. I'm still getting the same 500 error. I restarted my DNS server in WHM just in case but no luck. Apr 10, 2018 at 1:14
  • I had something similar, and I started putting debug points ( echo "got here";exit; ) into index.php and the files it called. It seemed to fail at invoking the main instance of Craft. I haven't resolved that. So I don't know if this helps.
    – kr37
    Apr 10, 2018 at 5:13

1 Answer 1

1

On the public_html/index.php file, try replacing

define('CRAFT_BASE_PATH', dirname(__DIR__));

with

define('CRAFT_BASE_PATH', ('/home/pathToCraftFolder/craft'));

The structure of my folders is as follow:

/home/username/
- public_html, or just html / this is where the content of your web folder goes
- config
- modules
- storage
- templates
- vendor
- (and then the composer/env files)

Then on the index.php file (which can be found under /home/username/public_html/index.php),you'd replace:

 define('CRAFT_BASE_PATH', dirname(__DIR__));

with

 define('CRAFT_BASE_PATH', ('/home/pathToCraftFolder/'));

If you only have access to the public_html folder or would like to install craft3 on a subfolder this is how you can structure it:

on your public_html (/home/username/public_html), create a craft subfolder((/home/username/public_html/craft)), then send your craft3 web folder into the public_html. It should look like this:

/home/username/public_html/
-index.php
-web.config
-.htaccess
/craft/

In your index.php file, replace

define('CRAFT_BASE_PATH', dirname(__DIR__));

with

 define('CRAFT_BASE_PATH', ('/home/pathToCraftFolder/craft'));

Hope this helps.

5
  • I'm going to assume you meant the /home/username/public_html/craft/web/index.php file since that's the only one with this line. I changed it to define('CRAFT_BASE_PATH', ('/home/username/public_html/craft')); , then reset my apache server and nothing's changed. Apr 12, 2018 at 18:58
  • I updated my answer Apr 13, 2018 at 22:42
  • I saw. Unfortunately I think the issue is more related to what PHP extensions are available for easyapache4 and PHP7. I can't account for about 1/2 of them, but since my directory is set up the way you described, and I've got everything else set up right, I'm not really left with much of a choice but to believe that's the case. As I said in a comment thread on my OP, I'm going to try running an install on Arcustech and see if I can't recreate this issue. Apr 15, 2018 at 1:00
  • Can you check the logs under storage/logs/web.log to get the real reason why you're getting that error message. Apr 17, 2018 at 5:10
  • If you are using easyapache/CPanel then the wbe root folder needs to be chmod 0750 and chown: user:nobody
    – joomkit
    Jul 3, 2018 at 9:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.