Where is the process I executed throught the web page? - php

I am running a server on my localhost.
through my index HTML page I am executing proccesses, (with the help of php page).
Now, if I am running those programs by myself and not throught the web browser in the html page,
I can see them as applications in the Windows Task Manager (in the Applications bar), and also the windows of the applications themselvs, and the output in running time.
But when I am executing those apps throught the web page, I cannot see them at all (The server and the applications are on my computer)
Why is that? I want to be able to see the result they show me in running time but I cant.
Is there any way to change that?
OS: Windows XP
Server: WampServer 2.2

Did you enable Show processes from all users ?

Related

Using website to stop and launch applications on same machine

I am in the process of setting up a website for users to sign up for accounts to access applications on a server running Windows Server 2019 with IIS, MySQL, PHP, and FastCGI.
The website works fine, the applications work fine, but it becomes rather tedious to have to login via RDP to restart an application if it hangs up, needs a manual update, etc. I have tried searching via google, and came up empty on this, but is there a way via php, jquery/AJAX, etc., to click a button on my website's admin panel to send a command to Windows to shutdown and/or restart an application?
Example:
Let's say I have my website located at C:/webroot/htdocs/" and an application at "C:/servers/server1/server.exe
I want to send a command from the website to close any active windows for server.exe (the console window(s)) if I hit "Stop Server" on the webpage. If I hit "Start Server" it will send a command to launch the server.exe program. Finally, if I hit "Restart Server" it will perform the stop action, followed by the start action in a single click.
Is this possible without needing to purchase any type of third-party application?
I know there are cron jobs, but I am not sure exactly how to utilize them, especially in this type of scenario.

How to open an external GUI application from web browser using PHP?

I'm new to web development. I'm trying to execute a shell script using PHP's shell_exec(). Inside the script, I'm trying to invoke a GUI application(Qt). When I executed the PHP script from a terminal the application started as expected. But when I opened it from browser an empty blank page appeared.
I'm using Ubuntu with apache2 server running as service. When I searched in google, the similar problem is solved in the Windows environment by allowing apache service to interact with the desktop.
PHP Script:
<?php
$log = shell_exec('sh testcmd.sh');
?>
testcmd.sh:
./Program1
Any help provided will be highly appreciated.
It is somewhat unclear what you're asking.
If you wish that browsing to a certain web site will run a PHP script that will open a GUI app for the client to interact with, the answer is "you can't". The reason is that the way the setup works is that the server and the client run on different machines, and your PHP runs on the server machine. As such, the client never gets to see the running program.
The above is true also for Windows. The answer you quote in your question does not apply to a server running on a different machine than the client.
If, for whatever reason, you want something that works only when the server and client run on the same machine (or there is someone watching the server's display), then you need to do the equivalent of the Windows answer.
The graphics display on Linux (assuming you're not running wayland) is using a protocol called X11. In order for the display to appear, your GUI program needs two things. The first is to know which display it needs to use. This is supplied with an environment variable called DISPLAY. The second is an authorization to actually use that display.
So in order for your PHP script to run a GUI app that will show its GUI, you will need to first do the following steps:
Set the DISPLAY variable to the correct value (copy from your desktop environment).
Run xauth add something, where you can get what something is by running xauth list on your desktop environment.
If you do these two things (in this order), your GUI should show up.

Does HTML5 wih php require a webserver?

I am studying on YouTube HTML5 forms with PHP files; the videos either start with a web page containing the form and link to a PHP file or they put everything in php files; I copy the instructors exact files; but they do not work: nothing is posted after filling the form and hitting the submit button.
I have had the files on a USB flash drive then tried them actually on the computer: nothing.
My question is then: "Do I need to have an actual server on my computer in order for PHP files to function?"
Yes. PHP requires a web server to run on.
You can run it on your own computer; the web server doesn't have to be connected to the internet while you are creating and testing your PHP scripts off your local machine. You can read more about this on the official PHP What do I need page
You can download one of the following local servers:
Windows: WAMP
OSX: MAMP
Linux: LAMP
XAMPP is also an option, it's cross-platform (as referenced by ATechGuy)
Here is a good explanation of Why a web server is required to run PHP. Basically it is because PHP is a dynamic server-side scripting language.
However if you just want to run simple PHP scripts, with no web pages. This is possible without a web server running. See this question: How can I run a php without a web server?
Yes, PHP will need to run on a server in order to execute. If you have a Mac, it should be equipped to run an Apache server. I found this article to be really helpful when developing with PHP - https://jason.pureconcepts.net/2015/10/install-apache-php-mysql-mac-os-x-el-capitan/
Yes. PHP files contain code that must be handled by an interpreter, that is, a program that reads the PHP code and outputs accordingly. This can be done without a webserver (using command line php) but PHP is most commonly used with a web server.
You want to setup some sort of stack with a web server and php. A lot of beginners use apache as a web server, and since you are comfortable using youtube for learning, a simple search for "apache php" and your operating system.

PHP exec() , showing executed exe file in task manager but not displaying

i have used simple PHP script to execute exe file through php script, below is my PHP code
<? exec('"C:\Windows\notepad.exe"');?>
my problem is, when i check task manager after executing above code, notepad.exe is there but it is not diplaying
same way if i execute below mentioned code
<? exec('"C:\Program Files\WinSCP\WinSCP.exe"'); ?>
task manager shows WinSCP.exe, but winscp is not diplaying
can anyone tell me why applications are not showing ?
Whatever your web server is (Apache, Nginx, IIS...) it's clearly not configured to run with the credentials of your administrator user account. That's the sensible default. Background services are designed to run unattended.
You have several choice, from worse to better:
Kill security in your web server configuration. If web server runs as service, open Windows Service Manager and configure it to run with your account (don't forget to come back here if you change your password in the future). This way you allow any stranger in your computer, local network and/or internet to run programs in your name, in this case Notepad and WinSCP.
If the web server allows it, run it from a command-prompt in your own session. It's similar to #1 but will at least not run 24/7.
Any of the above, with a restricted account.
Don't use a web server. PHP can run from the command-line just fine, what means that you can even create a *.bat file and assign an icon to it.
As about your code, when it finally works your script will sleep until you close Notepad. This can be a bug or a feature depending on your needs.
Had the same problem with WAMP 2.4 & windows XP, the following helped:
Win+R, services.msc
edit wampapache and wampmysqld to allow affecting desktop.
Alternatively you can try:
Win+R, services.msc
edit wampapache and wampmysqld to log on as the same user.

Windows desktop icon for starting PHP application

I created a PHP application with Zend Framework that I would only ever like to run locally with an XAMPP installation.
I've never coded in anything but PHP, so I would like to know what technologies are involved in creating this functionality:
User double-clicks a desktop icon.
XAMPP starts
Apache and MySQL start.
Browser opens pointed to "localhost"
What technologies do I need to learn in order to accomplish this?
Unless you want to do this with a custom written application as #rlemon recommends, you should be able to do it with a batch file. It's the Windows version of script files.
Resources/hints to give you some ideas:
Microsoft Windows XP - Batch files general overview on MSDN
How to start and stop XAMPP server from the XAMPP docs
The start command (Running start http://localhost in the batch file should work to open the web browser)
I don't know any program that will start you the servers, and after they are up and running then launch the browser. What I've used is Mozilla Prism, this program gives you the ability to make a web site to show up in the desktop, quick launch or start menu like any other program.
You can enable/disable the back & forward button, the address bar and some other nice configs.

Categories