【问题标题】:php shell : how to run code in existing filephp shell:如何在现有文件中运行代码
【发布时间】:2013-10-12 18:59:34
【问题描述】:

启动 php shell 后

php -a

您如何运行现有的 php 文件,例如“index.php”?我知道它可以像

一样运行

$php index.php

从命令行。但是你如何从 shell 中做到这一点?

【问题讨论】:

    标签: php shell


    【解决方案1】:

    您只需包含它:

    include 'index.php';
    

    【讨论】:

    • 在高速上也有 5000
    • 你又来了:)
    • @VihaanVerma 刚刚对其进行了测试以确保它确实有效!也许你没有从正确的目录调用它?
    猜你喜欢
    • 1970-01-01
    • 2018-07-13
    • 1970-01-01
    • 1970-01-01
    • 2011-03-04
    • 1970-01-01
    • 1970-01-01
    • 2023-02-08
    • 1970-01-01
    相关资源
    最近更新 更多