We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

webtools.php displays a blank page

I am very new to both PHP and Phalcon.

I have just setup a win 7 x64 VM with a manual install of Apache2.4, php7.0, MySQL5.7 and Phalcon 3.0.4. Everything does seem to work properly. I can create a project ' test ' with webtools enabled and I can browse to the default site page that says you are now flying with phalcon. The problem is I cannot open the webtools page when I browse to:

https://localhost/test/webtools.php

I get a blank page. The devtools.log has the following error:

php: [ERROR] Uncaught exception: Resource's content for 'https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js' cannot be read in C:\Apache24\htdocs\test\cache\Phalcon_Web_Tools_Views__layouts_webtools.php on line 18

I have checked my config.php and have set the baseUri to

'baseUri' => '/test/',

I have checked the permissions on the test folder to ensure that all groups have full access to the directory.

This is my webtools.php:

use Phalcon\Bootstrap;

include 'webtools.config.php'; include PTOOLSPATH . '/bootstrap/autoload.php';

$bootstrap = new Bootstrap([ 'ptools_path' => PTOOLSPATH, 'ptools_ip' => PTOOLS_IP, 'base_path' => BASE_PATH, ]);

if (APPLICATION_ENV === ENV_TESTING) { return $bootstrap->run(); } else { echo $bootstrap->run(); }

This is my webtools.config.php

defined('PTOOLS_IP') || define('PTOOLS_IP', '192.168.'); defined('BASE_PATH') || define('BASE_PATH', dirname(dirname(FILE))); defined('APP_PATH') || define('APP_PATH', BASE_PATH . DIRECTORY_SEPARATOR . 'app');
defined('ENV_PRODUCTION') || define('ENV_PRODUCTION', 'production'); defined('ENV_STAGING') || define('ENV_STAGING', 'staging'); defined('ENV_DEVELOPMENT') || define('ENV_DEVELOPMENT', 'development'); defined('ENV_TESTING') || define('ENV_TESTING', 'testing'); defined('APPLICATION_ENV') || define('APPLICATION_ENV', getenv('APPLICATION_ENV') ?: ENV_DEVELOPMENT);

defined('PTOOLSPATH') || define('PTOOLSPATH', 'C:\php-phalcon');



43.9k

Hi,

be sure to get a working internet connection. Asset manager can't build the javascript bundle because ihe can't access to https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js.

See here the code: https://github.com/phalcon/phalcon-devtools/blob/master/scripts/Phalcon/Mvc/Controller/Base.php



1.3k

Hi

Thanks for the reply, but I am quite certain my internet connection is working. I am currently typing this from the very same VM I am doing the development on.



43.9k
Accepted
answer

try to comment the line (line #113) where html5shiv.min.js is loaded in the file i've pointe in the previous post.



1.3k

Thanks. Commenting out those lines loaded an unformatted page. Downloading and storing these files locally and changing these lines to add them from a local directory worked the same way as well. These same lines exist in the errorcontroller.php as well. I had to edit that file as well.

I managed to resolve the unformatted webtools page using the your suggestion here: https://forum.phalcon.io/discussion/15111/webtools-can-not-load-css-if-using-different-baseuri