CodeIgniter 4 - Refused to get unsafe header "Debugbar-Time" - codeigniter

I just installed CodeIgniter 4, configured the .env file to "development" and did also set the base url. For some strange reason, when I load a controller I get this error concernig the CI debug bar:
How can I solve this error?
Thanks!

You can try by removing 3rd party js plugins. In my case Paypals checkout.js is causing the issue when ci4 is in development environment. It will be gone when you switch to production

This Answer maybe too late. But I just want to inform to some poeple that have an issue like this. So in my trouble, I just remove some js in my apps. It's work for me.

Related

Did I solve my "Target class [mail.manager] does not exist." issue?

Just upgraded from Laravel 6 to 7, and had the error response above when submitting a contact form. I eventually found a solution that seems to work and I am submitting here to help out the next guy.
In the terminal run:
composer require illuminate/mail
Add the following to the top of the controller file (app/Http/Controllers/Main.php in my case):
use \Illuminate\Support\Facades\Mail;
Add this to bootstrap/app.php:
$app->register(Illuminate\Mail\MailServiceProvider::class);
Save and test, and it worked localhost.
If the above does not work for you, there are some other possible issues and solutions available at this link, where I must give credit to vipindasks.
https://laracasts.com/discuss/channels/lumen/lumen-52-mail-not-working
Since I am suppose to ask a question:
Do you see any problems with this solution even though the site and mailer is working now?
You are simply missing a backslash. This tells the autoloader that the file you are looking for is not in the namespace your controller resides in :
$app->register(\Illuminate\Mail\MailServiceProvider::class);
Run composer update hope this will help you

PHPUnit testing in PhpStorm token mismatch exception

I am running unit testing on a Laravel project through PhpStorm inbuilt test environment. I am getting token mismatch exception.
All the configurations are correct and it was working fine. Suddenly this error showed up. I tried with the terminal and it works fine. I am developing this projects under Vagrant.
What can I do to solve this issue?
I googled and found out that changing Laravel's VerifyCsrfToken as below will solve this issue. But I need this to be default as well.
$except = ['/*']
I was experiencing the same problem, i fixed it by setting the "Default configuration file" option in the chosen "Test Frameworks" to the phpunit.xml in my project root. It seems PHPStorm by default uses a 'local' phpunit config. I came to this idea while checking the runningUnitTests() method in Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
and seeing dat APP_ENV was "local" and not "testing" as specified in my PHPunit.xml
Hope this helps.
I used WithoutMiddleware trait in my testing class. It worked fine. And I tried #Lijubadr 's reply also. It worked too. thank you.

Renaming my Laravel 4 root directory makes it doesn't work. What's wrong?

I got Laravel 4 zip file from gitHub. ("laravel-master").
run composer and get all the dependencies.
i can access it from: "127.0.0.1/laravel-master/public"
but when i rename the "laravel-master" to other names, and then try to access it, i get:
"HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request."
I can not figure out what's going wrong !
You need to set your vhost docroot to /public most likely. You shouldn't be able to access it at /public since that should be the root.
Because you specifically mentioned MAMP (in the comments to an answer below), try going to Preferences on the MAMP app page, and click "--" in the cache dropdown of the PHP tab.
A simple refresh after that cleared up this same issue for me.
see Apathetic012's comment on a similar issue on Github (https://github.com/laravel/framework/issues/625)
EDIT: specifying where MAMP was mentioned.

Spring security login error

I just implemented a simple login functionality using spring it how ever worked with the eclipse in built browser but gives the following error in chrome and firefox.
HTTP Status 404 - /SpringLogin/welcome.jsp;jsessionid=8332D4F3D4709DCA37C87F30F1EA03D5
The requested resource (/SpringLogin/welcome.jsp;jsessionid=BEE789093FF79CB6B67F8DA368E8B3E4) is not available.
can you please tell me why it is happening?
PS: I have two projects SpringLogin and both of them had same project names and both had similar packages. Then neither of the projects worked properly and gave the above error. How ever after I created another project with a different name and using different package names, it worked like magic. I am guessing here that it may have been the problem. But what is the logical answer that'll explain what happened there?
you don't have being calling the correct URL
it seems that the context /SpringLogin/ does not exists anymore.
Try /welcome.jsp or if you changed the name of application - try /newappname/welcome.jsp

CodeIgniter 2.0.2 syntax error blank page

CodeIgniter 2.0.2 syntax error blank page
i have CodeIgniter 2.0.2 (CI) and its annoing, that when i write lots of code and then just get blank page. Hard to debug without error. i got error reporting E_ALL in php.ini and in config of CI its turned on for every case of enviroment (devel, product) just for sure...
Does anyone knows, where the bug can be? How to turn it on? I think CI is rewriting php.ini error reporting setting somewhere somehow...
Thanks.
The other thing to check in your php.ini are the 'display_errors' and 'display_startup_errors' variables, they should both be set to 1.
In my (little) experience with CI this issue has been the most frustating one. I can understand that no framework is perfect, and any web developer is used to deal with errors (no matter if the framework or the developer is to blame). But that ANY error results in a blank page, with ZERO information in logs, console, whatever, is unacceptable.
If I recall correctly, in my case this was caused by of some combination of CI (ab)using the "silent error" PHP operator (e.g. prepending some db statements with the # operator, a not very clever way of avoiding leaking potentially private information to the end user), together with some bad use of *error_reporting*. See my post here (and see how many answers I got!).
I reported another related CI's idiocyidiosyncrasy related with logging here (again, zero answers)
please check the index.php which locate in the SAME LEVEL of the application folder
inside the index.php the second line
line 2:
ini_set("display_errors", "1"); //ensure it is set to 1
line 23:
define('ENVIRONMENT', 'development'); // development | testing | production
grep your php.ini for the word "error", turn them to On etc...
Do you have output compression turned on in the config? I find that will cause white pages when you have errors.
$config['compress_output'] = FALSE; // Should be set to this when developing.
I had the same problem and eventually fixed it when i noticed I had no 'logs' directory in my application folder

Resources