dongtanzhu5417 2014-11-29 01:42 采纳率: 100%
浏览 157

在laravel框架内运行独立的.php

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.

  • 写回答

2条回答 默认 最新

  • donglu9445 2014-11-29 03:40
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入