How to check Trace or log file in YII? - php

I Want to use log functionality from YII and i am new to YII.
Can anyone guide me where is file location of logging content? or tracing content?

If you are using default Yii main.php file then all the logs go to your protected/runtime/application.log file. It will include standard Yii logs as well as you own Yii::log() calls too.

Related

How to edit the view of "The page has expired due to inactivity" in Laravel 5.5

In Laravel 5.5, When you are using CSRF protection (by default) and you send a post request after long inactivity you'll get this error page (Screenshot).
I'm ok with this error however, I need to change the view/text of this error to match my application style and my language for sure.
Any Ideas in how to edit this view?
You can override the default view by placing a 419.blade.php file in the resources/views/errors folder.
If you're using an editor with global search capabilities, you can search for the error message inside your project. For example, in Visual Studio Code you can press Ctrl + Shift + F to search inside the project.
I use it all the time to find the files which are part of the framework that I need to customize.
More on overriding the error views in this section of the official docs.
You can override the default view by placing a 419.blade.php file in the resources/views/errors folder.

Unable to access controllers of codeigniter which is installed under a wordpress site

I have a Wordpress site. So all i wish is to fetch the information from those database tables and create my own custom API's. For that i opted CodeIgniter Framework.
The file directory system looks like this in my FTP
My codeigniter files are placed in apps folder
The problem is the pages are not loading, It always returns 404 Error
or No Input file specified/found etc.
I tried changing .htaccess file but no luck.
But if i specify
applications/apps
i.e controller/method in default_url in routes.php it works fine.
and if i click on the Hyperlink, i am trying to load another view or call another View(a web page) but this returns 404 error page not found.
What might be the reason behind this.

How to create log files using codeigniter

My project is going on using codeigniter.
I am new to codigniter and I want to bring log module into my project.
I want to capture all activities including errors into the log file.
Do i need to make changes in all page to store changes in log file.
where should i write function for this , whether in controller or library.
Is the log module feature exist in codeigniter?
can anyone give me the solution for this
Create library or helper and use Autoload. AFAIK codeigniter have no such default kinda library or helper, you need create your own or do research for external one.
EDIT :
My bad, try to find $config['log_threshold'] = 0; and $config['log_path'] = ''; in your config.php

About CodeIgniter 403 Error

I just recently got a project based on CodeIgniter and I am total beginner.
I have added new view in my CI views and I want to load it to popup window when I press on a given link. But I get that my playerview.php page is forbidden on this server error 403. So where should I edit or change settings so that I have permission to use my new view?
The .htaccess file has only one line and it says
Deny from all
You can't call a view directly from a browser. Views are loaded by controllers, and controllers are called based the URL. It is typically www.yoursite.com/controllername/functionname
If you read the general topics section of the CI docs, it will all make sense.

zend framework problem with paths

I have installed zend framework on my local machine. I have configured a vhost in httpd.conf and have added a line in my hosts file (127.0.0.1 mysite). I am running windows 7. Everything works perfect. The problem is when i upload on a hosting server the paths get mixed up.
I am uploading on a remote dir called zf-framework. To access the index page i need to type this url: http://mysite/zf-framework/public. It displays the index page but when i press any links on the page they get mixed up and end up being something like http://mysite/controller/action when in fact it should be http://mysite/zf-framework/public/controller/action. I have found a work-around for this situation...to use echo $this->baseUrl(link) for any links i have in the layout.phtml. The problem is more serious when it comes to submitting forms. I can't use baseUrl there....or i don't know how to use it. Is there a way to write some general config stuff so that this could be automatically resolved by the framework. Let's say to write something in index.php or bootstrap.php that will fix the paths automatically?
If you're using Zend_Application, then add the following to your configs/application.ini file.
resources.frontController.baseUrl = "/your-path-here"
If you're not using Zend_Application, then do this in your bootstrap, or index.php file.
$front = Zend_Controller_Front::getInstance();
$front->setBaseUrl('/your-path-here');
You won't have to use $this->baseUrl() when submitting a form to the same action and controller (just leave out the action attribute in the form tag), or when using the Redirector action helper. However, links in your view scripts will require you to $this->baseUrl('/url-without-base'), which doesn't seem too bad to me.
I am not 100% on this, but if you specify the route in your routes.ini as zf-framework/public/Controller/Action etc this should fix your issue.
I would see this as a bandaid, but I am not 100% sure on how to properly fix your issue other then you modifying the vhosts file on the remote server to set a document root to the public folder. If that is not an option, well the above should work, but know that all of your files are potentially accessible from everyone (at least your folder structure). I am not sure what harm this can do (if any) other then if your database schema is in the /data directory.
It is better to try and get the public set as the web root, if possible.

Categories