I have a python autobahn script (websock) running and working perfectly with the browser, i need to send data from another server running PHP to the python server. is there any PHP websock clients that are compatible with the latest autobahn (websock) protocol ?
i have tried some, but neither worked
like this one
https://github.com/lemmingzshadow/php-websocket/blob/master/client/test_server.php
it didn't !
Ronan,
Take a look at the Thruway project. It's a WAMPv2 PHP client/server that's compatible with the current version of autobahn.js.
You can also find more information on how to create a simple PHP client here.
Related
I need to connect to a SOAP endpoint from a windows machine, however, the PowerShell New-WebServiceProxy cmdlet fails to process the WSDL. I can't change the WSDL, and I have the connection working in PHP.
I'm not too sure about using PHP just as a scripting tool. What other tools might be available to get the SOAP endpoint running, and C# seems overkill for this.
other features I need in the scripting tool
- watch/open a file that is created
- find rows that a different in the Files (CSV)
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.
I'm trying to follow a tutorial for my first php project in netbeans. I select new php application name it and then simply type echo("anything") in the php portion of index.php and when I run it I always get the error Oops! Google Chrome could not connect to localhost. I don't understand why because I also have a Java web application(selection from netbeans) and when I put stuff in the html I can get things to run just fine. How can I get rid of this issue?
Make sure that PHP is running on your machine (XAMP or WAMP) and it should be echo "anything";
PHP requires that the PHP parser is running on a server. The error comes from a lack of this. HTML requires no parser so it can be sent as is. The java web application may have a module to enable PHP, and you likely need to either enable it or tell it where a PHP binary is; if not both.
Alternatively, you can use XAMPP/MAMPP to host the server; just make sure it is not running on the same port as your java host.
You can get XAMPP/MAMPP here:
www.apachefriends.org
Am using windows server for running website. My application is running in linux server. I want to call the application with parameters(inputs) from website using php. The application accepts some inputs and returns output. I want to display the output in website. Please some one help me by giving idea or scripts. Thanks in advance.
From your simplistic description, you might be able to use this on the windows webserver to invoke the application part residing on the linux server:
<?php
readfile("http://otherserver.com/app.php?input=123");
?>
If the inputs are expected via POST, then you'll have to utilize cURL instead. (Which you'd have to do in case of a disabled allow_url_fopen anyway.)
You can use WinExe in your Linux system and execute command from your PHP to remotely call command lines on your Windows system
I want to ask a conceptual question: how a server written in php works?
Actually I want to know when I write a simple php code to get some information from a client, how does the whole process happen?
In java I have to start server first. Server listens to the port. When any client knocks then connection creates. Is it similar to php? Before running client application do I have to run my php code or server will do that for me? I am using localhost.
see this article: http://kevin.vanzonneveld.net/techblog/article/create_daemons_in_php/
Before running client application do I
have to run my php code or server will
do that for me.
This depends on your server architecture, you can use something like inet.d which invokes your script only if there is access on that port, or you have the standalone version, where you start the php from console und it waits for connections.
Does it similar to php ?
Yes.
Before running client application do I have to run my php code or server will do that for me.I am using localhost.
If you are writing a server in PHP then your PHP code is the server.