Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6154539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:16:45+00:00 2026-05-23T20:16:45+00:00

I need to execute a php file with parameters through shell. here is how

  • 0

I need to execute a php file with parameters through shell.

here is how I would run the php file:

php -q htdocs/file.php

I need to have the parameter ‘show’ be passed through and

php -q htdocs/file.php?show=show_name

doesn’t work

If someone could spell out to me what command to execute to get the php file to execute with set parameters, it would be much appreciated. If not, try to lead me the right direction.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:16:46+00:00Added an answer on May 23, 2026 at 8:16 pm

    test.php:

    <?php
    print_r($argv);
    ?>
    

    Shell:

    $ php -q test.php foo bar
    Array
    (
        [0] => test.php
        [1] => foo
        [2] => bar
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a php file from which i need to call a shell script
I need some help with priviligies in centos I have a file in home/admin/public_html/generate.php
I have a unix command written in a file and I need PHP to
I have a PHP script that I need to run every minute. I have
I would like to create a php script to execute a shell command and
I need to execute MDX query from command line (MS AS 2005). I have
I need to execute a script in the background through a service. The service
I need this cron job to execute my shell just as it does when
I've downloaded python installer from http://www.python.org/ftp/python/3.1.2/ , this python-3.1.2.msi file, I need to execute
i need to run a really long php script (four and half, five hours).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.