Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Phalcon blank page

Edit: So I managed to get frontpage to load by creating a new project and copying my app directory.

However I get errors on the frontpage and no images, basically minumum functionality.

Error img

The cache reads:


        <nav class="collapse navbar-collapse bs-navbar-collapse-1" role="navigation">
            <?= $elements->getMenu() ?>
        </nav>

The main.volt reads:


        <nav class="collapse navbar-collapse bs-navbar-collapse-1" role="navigation">
            {{ elements.getMenu() }}
        </nav>

I guess its not loading my template (under app/libary).

So I added in config.php:


        'libraryDir'     => APP_PATH . '/library/',

and under services.php


$di->setShared('elements', function(){
    return new Elements();
});

and under loader.php


APP_PATH . $config->application->libraryDir,

Still same error...

Elements.volt (under app/library) reads: ...


<?php

use Phalcon\Mvc\User\Component;

/**
 * Elements
 *
 * Helps to build UI elements for the application
 */
class Elements extends Component {
    private $_headerMenu = array(
        'navbar-left' => array(
            'menu_dropdown' => array(
            ),
            'about' => array(
                'caption' => 'About',
                'action' => 'index',
            ),

            more navbar code...

Thank you for any help!


Edit: Ok so I'm pretty sure I was using Phalcon 2.X before and 3.1 now. Shouldn't it still work?

If not, what do I have to do in order to get Phalcon 3.X to work with my old project folder?


Hello,

My phalcon returns blank page. I have not changed anything in the project folder, I even tried builds from months ago (worked then) and still blank. So it has something to do with my configuration.

I updated windows 10 and reinstalled both vagrant and oracle vm virtualbox.

I then followed these install instructions:

https://github.com/phalcon/vagrant#installation

Project page is blank, inspect cc gives nothing.

I tried invo and it works but no images. If I remove something from index.php it gives error, so it loads for sure.

This is my index.php


<?php

error_reporting(E_ALL);

use Phalcon\Config\Adapter\Ini as ConfigIni;
use Phalcon\Mvc\Application;

//$_GET['_url'] = '/contact/send';
//$_SERVER['REQUEST_METHOD'] = 'POST';
date_default_timezone_set('Europe/Stockholm');

try {

    define('APP_PATH', realpath('..') . '/');

    /**
     * Read the configuration
     */
    $config = new ConfigIni(APP_PATH . 'app/config/config.ini');

    /**
     * Auto-loader configuration
     */
    require APP_PATH . 'app/config/loader.php';

    require APP_PATH . 'vendor/autoload.php';

    /**
     * Load application services
     */
    require APP_PATH . 'app/config/services.php';

    $application = new Application($di);

    $di['forms'] = function () {
        return new \Phalcon\Forms\Manager();
    };

    $debug = new \Phalcon\Debug();
    $debug->listen();

    echo $application->handle()->getContent();

} catch (\Exception $e) {
    echo get_class($e), ": ", $e->getMessage(), "\n";
    echo " File=", $e->getFile(), "\n";
    echo " Line=", $e->getLine(), "\n";
    echo $e->getTraceAsString();
}

Phpinfo() shows that phalcon is installed:

Link to phpconfig images

Please help!

Thank you!

Sincerely, Johan



538
Accepted
answer

Well I got it to work in the end. Got a fresh invo copy and then copied my /app step by step. I'm sure some more errors will come up but we'll see about that tomorrow.

Thank you!