Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

run independent .php inside laravel framework

Tags:

php

laravel

I recently installed laravel framework in my laptop.I installed laravel in my Xampp server's htdocs/laravel/laravel source path

How can I run execute written PHP codes normally in browsers and run execute them out side laravel framework?

That means if I create a new .php file in desktop that will show "hello world". Where I should keep that file or in which folder to show my this individual file run in browser only inside laravel framework.

like image 891
Ibrahim Khalil Avatar asked Nov 29 '14 01:11

Ibrahim Khalil


1 Answers

You can put it inside your public directory. If your application has a domain of localhost you can access it via localhost/script.php. BUT this is extremely ill-advised as you are opening yourself to potential vulnerabilities depending on what your script does.

If it is for testing then fine. Otherwise you will have to put that somewhere in your application say app/scripts/script.php where it cannot be accessed via the browser (the only point of stand-alone scripts in web application is for CRON tasks or for CLI commands). If this is the case, you may want to take a look at http://laravel.com/docs/4.2/commands about writing your own artisan commands.

like image 132
turntwo Avatar answered Oct 26 '22 17:10

turntwo