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

PHP Debugbar is not working #18

Closed
gpphong8th2 opened this issue Oct 20, 2015 · 4 comments
Closed

PHP Debugbar is not working #18

gpphong8th2 opened this issue Oct 20, 2015 · 4 comments

Comments

@gpphong8th2
Copy link

Hi All,
Sorry, My English is not good.
I have add phalcon-debugbar from this link: https://github.com/snowair/phalcon-debugbar.
but it is not working.
When I run, In my console is display:
2015-10-20_162412
I found error:
dashboard:449 GET http://dashboard.somo.local_debugbar/assets/stylesheets?1445331526 net::ERR_NAME_NOT_RESOLVED
dashboard:450 GET http://dashboard.somo.local_debugbar/assets/javascript?1445331525 net::ERR_NAME_NOT_RESOLVED
dashboard:453 Uncaught ReferenceError: PhpDebugBar is not defined(anonymous function) @ dashboard:453
sb-admin-2.js:2 Uncaught TypeError: $ is not a function

How to I can fix it ?

@snowair
Copy link
Owner

snowair commented Oct 20, 2015

Config the uri service currectly:

$di->set('url', function() use (){
    $url = new Phalcon\Mvc\Url();
    $url->setBaseUri('/');  // here
    return $url;
});

https://github.com/snowair/phalcon-debugbar/blob/master/README_zh.md#关于-baseuri

@gpphong8th2
Copy link
Author

thank you. But my config the uri service:
$di->set('url', function () use ($config) {
$url = new UrlResolver();
$url->setBaseUri($config->application->baseUri);
return $url;
});
In config file : 'baseUri' => 'http://dashboard.somo.local/'
I can not change 'baseUri' => '/' . because this affects config my website.
have other solution to this issue ?

@snowair
Copy link
Owner

snowair commented Oct 20, 2015

You should find out a way, to render the route /_debugbar/assets/stylesheets

from the wrong result:

 http://dashboard.somo.local_debugbar/assets/stylesheets

to the right:

 http://dashboard.somo.local/_debugbar/assets/stylesheets

@snowair snowair closed this as completed Oct 25, 2015
@luguiant
Copy link

luguiant commented May 24, 2017

in phalcon simple-service-provider ind .htaccess
`

ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access plus 1 month"

# add options Options -MultiViews RewriteEngine On RewriteRule ^$ public/ [L] RewriteRule ^((?s).*)$ public/$1 [QSA,L]
 # Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
`

and add in app\Bootstrap.php function getOutput()

(new \Snowair\Debugbar\ServiceProvider(MYPATH.'config/debugbar.php'))->start();

in

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

3 participants