How Do I Run a Php File in Linux?
Contents

How do I run a PHP file in Linux terminal?

php phpinfo(); ?> , simply by running the below command. and then point your browser to which opens this file in web browser. Here Option ‘-f’ parse and execute the file that follows the command. Here the option ‘-r’ run the PHP Code in the Linux Terminal directly without tags < and > .

How do I open a php file in Linux?

Open Terminal using Ctrl + Alt + T , now type sudo -H gedit , then type your password and press enter . This will open the gEdit program with root permission. Now open your . php file where it’s located or just drag the file into gEdit.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest