LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-22-2017, 08:01 AM   #1
sagxam
LQ Newbie
 
Registered: Dec 2016
Posts: 14
Blog Entries: 1

Rep: Reputation: Disabled
Question Running .php file


How do i run .php files in ubuntu 16.04, please give me steps of all the procedure, is there IDE for the same which one is the best?
 
Old 05-22-2017, 08:29 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,670
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
If you are running the script from the command line, there are two distinct ways to do it:
  1. Run the php command and specify as the first parameter the name of the file that you want to run.
  2. Make the file 'executable,' and on the first line add a "shebang" line such as: #!/usr/env php. (Use the command, which env to find out exactly where the env command is located on your machine.) Now, you can simply "run" the script: the shell will find the "shebang" line and thus know which programming language to invoke.

If you want to run the command in a web server such as PHP or nginix, then ... "just Google it." Which might find you hits like these:
 
1 members found this post helpful.
Old 05-23-2017, 12:36 AM   #3
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
Also, you may need to install php-cli on your computer separately, I don't believe all distros install the command-line php by default. On fedora php-cli is a separate package from php
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a PHP file upon startup NotionCommotion Linux - Newbie 1 12-10-2016 08:11 PM
Running php file automatic after login to Ubuntu 11.04 nsubage Linux - Software 2 07-29-2012 03:48 AM
Running a .sh file via PHP Shnooter Linux - Newbie 1 04-26-2011 06:36 PM
Apache downloads php file instead of running script cov Linux - Server 4 05-13-2010 04:33 PM
Running php file from shell? jchambers Programming 5 02-28-2008 05:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration