Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank Page on Initial Load #636

Closed
AdamDenoon opened this issue Mar 30, 2015 · 5 comments
Closed

Blank Page on Initial Load #636

AdamDenoon opened this issue Mar 30, 2015 · 5 comments

Comments

@AdamDenoon
Copy link

When I navigate to my server, I am successfully routed to the public folder of the application, and index.php is called (the Application.php file is also called, but the IndexController.php is not called). I am met with nothing but a blank screen in my browser.

My config.development.php file is as follows:

<?php

/**
 * Configuration for DEVELOPMENT environment
 * To create another configuration set just copy this file to config.production.php etc. You get the idea :)
 */

/**
 * Configuration for: Error reporting
 * Useful to show every little problem during development, but only show hard / no errors in production.
 * It's a little bit dirty to put this here, but who cares. For development purposes it's totally okay.
 */
error_reporting(E_ALL);
ini_set("display_errors", 1);

/**
 * Returns the full configuration.
 * This is used by the core/Config class.
 */
return array(
    /**
     * Configuration for: Base URL
     * This detects your URL/IP incl. sub-folder automatically. You can also deactivate auto-detection and provide the
     * URL manually. This should then look like 'https://192.168.33.44/' ! Note the slash in the end.
     */
    'URL' => 'https://' . $_SERVER['HTTP_HOST'] . str_replace('public', '', dirname($_SERVER['SCRIPT_NAME'])),
    /**
     * Configuration for: Folders
     * Usually there's no reason to change this.
     */
    'PATH_CONTROLLER' => realpath(dirname(__FILE__).'/../../') . '/application/controller/',
    'PATH_VIEW' => realpath(dirname(__FILE__).'/../../') . '/application/view/',
    /**
     * Configuration for: Avatar paths
     * Internal path to save avatars. Make sure this folder is writable. The slash at the end is VERY important!
     */
    'PATH_AVATARS' => realpath(dirname(__FILE__).'/../../') . '/public/avatars/',
    'PATH_AVATARS_PUBLIC' => 'avatars/',
    /**
     * Configuration for: Default controller and action
     */
    'DEFAULT_CONTROLLER' => 'index',
    'DEFAULT_ACTION' => 'index',
    /**
     * Configuration for: Database
     * DB_TYPE The used database type. Note that other types than "mysql" might break the db construction currently.
     * DB_HOST The mysql hostname, usually localhost or 127.0.0.1
     * DB_NAME The database name
     * DB_USER The username
     * DB_PASS The password
     * DB_PORT The mysql port, 3306 by default (?), find out via phpinfo() and look for mysqli.default_port.
     * DB_CHARSET The charset, necessary for security reasons. Check Database.php class for more info.
     */
    'DB_TYPE' => 'mysql',
    'DB_HOST' => '127.0.0.1',
    'DB_NAME' => 'huge',
    'DB_USER' => 'fakeuser123',
    'DB_PASS' => 'fakepass123',
    'DB_PORT' => '3306',
    'DB_CHARSET' => 'utf8',
    /**
     * Configuration for: Additional login providers: Facebook
     * CURRENTLY REMOVED (as Facebook has removed support for the used API version).
     * Another, better and up-to-date implementation might come soon.
     */
    'FACEBOOK_LOGIN' => false,
    /**
     * Configuration for: Captcha size
     * The currently used Captcha generator (https://github.com/Gregwar/Captcha) also runs without giving a size,
     * so feel free to use ->build(); inside CaptchaModel.
     */
    'CAPTCHA_WIDTH' => 359,
    'CAPTCHA_HEIGHT' => 100,
    /**
     * Configuration for: Cookies
     * 1209600 seconds = 2 weeks
     * COOKIE_PATH is the path the cookie is valid on, usually "/" to make it valid on the whole domain.
     * @see https://stackoverflow.com/q/9618217/1114320
     * @see php.net/manual/en/function.setcookie.php
     */
    'COOKIE_RUNTIME' => 1209600,
    'COOKIE_PATH' => '/',
    /**
     * Configuration for: Avatars/Gravatar support
     * Set to true if you want to use "Gravatar(s)", a service that automatically gets avatar pictures via using email
     * addresses of users by requesting images from the gravatar.com API. Set to false to use own locally saved avatars.
     * AVATAR_SIZE set the pixel size of avatars/gravatars (will be 44x44 by default). Avatars are always squares.
     * AVATAR_DEFAULT_IMAGE is the default image in public/avatars/
     */
    'USE_GRAVATAR' => false,
    'GRAVATAR_DEFAULT_IMAGESET' => 'mm',
    'GRAVATAR_RATING' => 'pg',
    'AVATAR_SIZE' => 44,
    'AVATAR_JPEG_QUALITY' => 85,
    'AVATAR_DEFAULT_IMAGE' => 'default.jpg',
    /**
     * Configuration for: Email server credentials
     *
     * Here you can define how you want to send emails.
     * If you have successfully set up a mail server on your linux server and you know
     * what you do, then you can skip this section. Otherwise please set EMAIL_USE_SMTP to true
     * and fill in your SMTP provider account data.
     *
     * EMAIL_USED_MAILER: Check Mail class for alternatives
     * EMAIL_USE_SMTP: Use SMTP or not
     * EMAIL_SMTP_AUTH: leave this true unless your SMTP service does not need authentication
     */
    'EMAIL_USED_MAILER' => 'phpmailer',
    'EMAIL_USE_SMTP' => true,
    'EMAIL_SMTP_HOST' => 'smpt.fakesmtp.com',
    'EMAIL_SMTP_AUTH' => true,
    'EMAIL_SMTP_USERNAME' => '[email protected]'',
    'EMAIL_SMTP_PASSWORD' => 'fakepassword123',
    'EMAIL_SMTP_PORT' => 465,
    'EMAIL_SMTP_ENCRYPTION' => 'ssl',
    /**
     * Configuration for: Email content data
     */
    'EMAIL_PASSWORD_RESET_URL' => 'login/verifypasswordreset',
    'EMAIL_PASSWORD_RESET_FROM_EMAIL' => '[email protected]',
    'EMAIL_PASSWORD_RESET_FROM_NAME' => 'My Project',
    'EMAIL_PASSWORD_RESET_SUBJECT' => 'Password reset for PROJECT XY',
    'EMAIL_PASSWORD_RESET_CONTENT' => 'Please click on this link to reset your password: ',
    'EMAIL_VERIFICATION_URL' => 'login/verify',
    'EMAIL_VERIFICATION_FROM_EMAIL' => '[email protected]',
    'EMAIL_VERIFICATION_FROM_NAME' => 'My Project',
    'EMAIL_VERIFICATION_SUBJECT' => 'Account activation for PROJECT XY',
    'EMAIL_VERIFICATION_CONTENT' => 'Please click on this link to activate your account: ',
);

ADDITIONAL NOTE: My application folder is in a subfolder within my web root: '/var/www/html/mysubfolder' Maybe this makes a difference?

Any help would be greatly appreciated!

@panique
Copy link
Owner

panique commented Mar 30, 2015

I would simply go exactly with the install tutorial and everything would work fine, or use the auto-installer! It's so easy, and it works out of the box every time. If you really want to go on with your setup, then please add some more infos, like your apache version, php version, etc., how you installed it etc.

@AdamDenoon
Copy link
Author

I followed the directions exactly, twice (I deleted and started again, same result). The only difference was that I didn't install it in the web root, but in a subfolder in the web root.

My 000-default.conf file looks like this:

<VirtualHost *:80>

    ServerAdmin webmaster@localhost

    DocumentRoot "/var/www/html/mysubfolder/public"
    <Directory "/var/www/html/mysubfolder/public">
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Everything else is exactly the same as the instructions indicated. The "huge" database populated correctly, my login info for mysql checks out, my login info for SMTP checks out, htaccess is redirecting properly... literally all I did differently than instructions was installed the application into a subfolder. Has anyone ever successfully done that?

@panique
Copy link
Owner

panique commented Mar 31, 2015

Hey, I the auto-installer installs in subdirectoy (have a look!) and it works perfectly, every time. Maybeyou can take the commands from the autoinstaller-sh-file and work with that.

@AdamDenoon
Copy link
Author

I will try the auto-installer after deleting my subfolder and everything in it. If that doesn't work, I'll uninstall mysql entirely and re-do it.

@AdamDenoon
Copy link
Author

As you guys would not be surprised, this worked.

What might actually surprise you is that according to the official apache docs, "www" is to be included for subdomain virtual hosts. This is my 000-default.conf file in sites-available:

<VirtualHost *:80>
    DocumentRoot "/var/www/html"
    <Directory "/var/www/html">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName www.mysubfolder.myserver.com
    ServerAlias mysubfolder.myserver.com
    DocumentRoot "/var/www/html/mysubfolder/public"
    <Directory "/var/www/html/mysubfolder/public">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

I also added an A record to my DNS service to redirect mysubfolder.myserver.com requests directly to my public IP.

So, when I go to myserver.com, it automatically loads the index.html file in my web root, and if I go to mysubfolder.myserver.com, it loads the "huge" application :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants