473,320 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to run .php files in xampp in cmd

Sir/Mam How can i run any php files through xampp in cammand line prompt??Plzz help!!
Jan 21 '13 #1
1 1946
Atli
5,058 Expert 4TB
You want to run PHP files through XAMPP, but in a CMD prompt window? That makes no sense.

You can use the Program Execution Functions to execute commands from PHP, so if you wanted to run PHP files written for command line prompts from a website PHP file, you could try doing that with, say, the shell_exec function.
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. // Create the command to execute the PHP file.
  3. // (Adjust the paths as needed!)
  4. $filePath = "/usr/bin/php /var/scripts/cmd_line_script.php";
  5.  
  6. // Execute the command and capture the results.
  7. $result = shell_exec($command);
  8.  
  9. // The result will be NULL if it failed, otherwise it'll be a string.
  10. if ($result) {
  11.     echo "<pre>{$result}</pre>";
  12. }
  13. else {
  14.     echo "<strong>Failed to execute PHP script.</strong>";
  15. }
  16.  
Jan 22 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jan Nordgreen | last post by:
The following code only generates the first csv file. The second request is just ignored. What am I doing wrong? I am using Mozilla Firefox, Windows XP, and Xampp. <?php require...
0
by: John K | last post by:
I am still pretty new to this environment and don't know much about httpd.conf. I understand that it is the place to configure the server but don't know how to actually use it for what I'm trying...
18
by: Frances | last post by:
I want to learn PHP.. I know JSP, Servlets, have been using Tomcat for 2 years now, and even though I know there are ways you can use PHP in conjunction with Tomcat, I'd rather not tinker with...
1
by: pjpinella | last post by:
Hik, I'm ready to buy a new desktop PC with Windows Vista, but need to be sure XAMPP will run on it OK. I'd much prefer to install using the XAMPP Windows install routine, rather than manually. ...
5
by: DavidNorep | last post by:
Hi, I installed basic xampp with the installer from http://www.apachefriends.org/en/xampp-windows.html#524. When I started Apache from the panel, I got a window with the error message: This...
5
by: r.g. | last post by:
Hello, Recently, my PHP (5, as installed by the XAMPP package) stopped working, and won't let me run locally-served PHP files in my web browsers. I think (but I'm not sure) that the Apache...
2
nomad
by: nomad | last post by:
I'm using Dreamweaver mx2004 and XAMPP. When I write a php in Dreamweaver and I want to view it in my Broswer it does not show. Under Dreamweaver Management I have saved by php file in these...
1
by: AD | last post by:
Hello! I have a problem with XAMPP portable server run on Windows XP platform. I was building an application on this server, but I`ve noticed strange behaviour. I think that it is something...
3
by: lollielala | last post by:
Hi every one, I'm new to xampp & configuring etc I've installed, uninstalled, & again with what looks like a successful install. http://localhost/phpmyadmin/ apperas to be working also...
2
by: pranoy | last post by:
HI, I am also facing this problem. I have XAMPP runing on Windows system and i have php 5.0 installed and GD library too. I have got the ffmpeg_new.rar from a weblink...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.