I have created a HTTP Server on Marklogic to run my application. Now my application has a xqy page. Form that xqy page I want to call a page which is written in PHP. How can I execute PHP page from Marklogic? I have also installed Wamp Server for PHP on my machine. From within the Wamp server that PHP code executes but I want to run that php script from my application which is hosted on Marklogic.
Make an http request via xdmp:http-request().
I think Eric must mean xdmp:http-get().
Related
I'm very new to networking, and backend web development. I have a simple task:
Set up an apache2 server on a Debian machine.
Host a website on the server.
Demonstrate client-server communication.
I've already configured the server, and hosted my website. But I'm having trouble getting a script to do some back-end processing.
It will be something incredibly simple. For example, the webpage has a single form field and a button. The user enters their name for example, and presses the button.
Then the server should run a script (e.g PHP) and output a greeting Hello, user.
How can I go about doing this? I need to pass the variable to the php script and then have apache execute the script. Any suggestions?
Thank you.
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 am developing with GWT in eclipse, its run ok and launch jetty server like spected, but when i try to communicate my gwt page with php i find jetty server handles php files like text files, just send file contents and does not executes php script.
I need jetty server for GWT code, and run apache/php for php code (in different ports), but jetty must redirect php calls to apache.
Searching in google i find a possible solution: a jetty handler could redirects php request to apache server running php.
Someone knows a better solution?
Someone knows how to add a handler to jetty server running embedded in eclipse?
is there a existing jetty handler what redirects calls (proxy) to another server?
Thanks in advance
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.