Is it possible to run Python code on an Apache server [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
What kind of server configurations would I need to do in order to run a Python + Pygame code on a website.
Is php able to call and execute the python on server side? Do I need to install python on the server? I believe python is installed, but do I need to install the pygame library? What if I compile my code, will I need to install pygame on the server after that?
Can some one provide me a general list of things I will need to complete in order to make this happen?
My case:
I would like to put a game I made with Python on a website. I see how the python can run on the server no problem, but how can I ensure the client be able to play the game on their browser?

Web Browser can display/run HTML+JavaScript+SVG+(HTML)Canvas or (Adobe) Flash. You can't use PyGame to create game running on page. PyGame doesn't generate HTML+JavaScript or Flash

There might be a Python plugin somewhere, but I don't know of it and I can't imagine it's very popular. Your best bet would be to use Pyjs, previously called Pyjamas, which can translate Python to JavaScript. It doesn't support Pygame, but you might be able to write a Pygame-compatible module using the browser's canvas support. It's not a solution that you can just drop in and go, but I don't think there is one.

Yes, there is a mod like mod_php... The extension of files are
.psp
Python server pages

Related

how to burn cd using php scripts or Any Api? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to enable windows cd burn using php script or any api key,or any programable language script.how it is possible to do that with php or any programable language script?
Please Suggest?
PHPs main function is preparing and building webpages to display in a clients browser.
I don't think there is any functionality to access the disk drive with PHP alone nor do I think it would be a good idea.
The only way I can think it would work is by running tools installed on the OS through php's exec() function
http://php.net/manual/en/function.exec.php
I Have not used these tools but that's what I found when googling commandline CD ripping and burning.
https://www.cyberciti.biz/faq/linux-ripping-and-encoding-audio-files/
FYI, php runs serverside only so using the linux tools would only work on the hosting machine.
With all the opensource disc management tools out there I cant work out why you would want to build one in php

SNMP monitoring & Web interface [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have read many articles, forums and informations about SNMP.
Even though I struggle with my project.
The goal of my project is to display data that I get from SNMP on a web page. (Nice designed interface). SNMP protocol is compulsory. And it should run on linux server (I want to add more devices in a final part of project e.g. router, switch.)
Could anyone tell me some quick info what has to be done (step by step review)?
I would be glad for every help. I am confused about what is the best way.
Ajax/database/websockets/traps?
I would like to use PHP or Node.js if it possible.
I'm doing a similar project for my internship :
I'm using Perl script for back-end with Net::SNMP for snmp request,
Perl CGI for front-end,
and JSON for DB.
I suggest using a framework to create the web interface, for example Django (https://www.djangoproject.com/) in python.
Then you could use a python library (pysnmp will be great) to retrieve the SNMP data, and create a custom View to show this data in a web page.
If you want to stick with PHP, you can use the functions described here http://php.net/manual/en/ref.snmp.php to access the SNMP server, and again using a framework will be great (Laravel, Symfony ...)

Is there any way to run PHP on Android [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I've tried to open my PHP script in the built in Android browser, but I only see my code, as text, and the PHP doesn't run. Why is that ?
How can I run PHP on my Android device ? Is there a way to set up PHP and a web server on an Android device ?
Okay, this is a bit of a personal recommendation, but I've had success with the free Palapa Web Server (edit: doesn't seem to be on the playstore anymore, but here's the creator's website in case it helps you find it), which is essentially a web / mysql server which runs on Android, which will run your PHP scripts, and it will also work offline.
To use it, install the app, and copy your PHP / HTML files onto your phone. By default, the app uses /sdcard/pws/www/, so if you put your files there, it should pick them up. Then, launch the app, click "Start server", and go to http://127.0.0.1:8080 with your web browser on your android device, and it should work.
Note that setting up PHPMyAdmin (if you need that for managing databases) can be a bit tricky, as you will need to download the extra packages for it.
Let me know if it works for you. (Note: I'm not affiliated with this app, I'm just a mostly satisfied user.)

Pure (dynamic) HTML5-website with Backend [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Couldn't find anything about this online so I'm giving it a try here. (Not sure what to look for in google so maybe that's why I couldn't find it).
My client wants (for some strange reason) a dynamic, pure HTML5-website with no PHP at all. The webpages can be created with PHP, but after he is done, he wants it to (automatically) generate HTML5-webpages so these can be put online on a server with no PHP.
Is this at all even possible? Writing an API myself that gets the content from the server and converts it to HTML5 is not really an option due to time ...
Thanks
FYI: If what you want is a Single Page Application, you're asking the wrong question.
Seems like what your client wants is a pure HTML site because he might have the idea that pure HTML sites are better for SEO.
What do to?
Alternative 1:
Create a different server to generate pages. Either local (with vagrant) or in another remote server. Have your content generated there by using a CMS of your choice.
Periodically generate a mirror of your site using a tool like HTTrack or wget. Hand this mirror to your client.
Alternative 2:
Use a static site generator like Jekyll. Have the server run a cron task to automatically generate HTML from the changes.
Alternative 3:
Be the expert and explain to him that his ideas are probably unfounded.
Yes, you could use the HTML5 Filesystem API and Javascript to read/write from a JSON file as a backend. It's definitely not ideal, but it would satisfy your requirements.

Deployment of php jqm mobile application on tablet/mobile [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have tried using phonegap , but the php scripts do not work?
Any other alternatives as to how the php jqm applications are deployed on tablet for testing?
PHP is meant to run on Proper Computer/Server as its a Server Side Language. So you need additional Software as the Browser does not have the ability to Interpret the PHP Language by Itself.
However its not a dead end if you wish to run PHP and JQM on a Device by itself.
On Android you can try KSWEB: server + PHP + MySQL Software which turns the device into a web server and includes PHP
Out of interest i just tested this software and it works. If you have an Android device download and install the software. The web server starts automatically. Transfer your whole folder (jqm+php scripts you have) in the htdocs folder on the phone, open a browser and type (localhost:8080/the-name-of-the-folder) and your jqm + php scripts will run ok.
https://play.google.com/store/apps/details?id=ru.kslabs.ksweb&hl=en
Alternatively Check Ubuntu touch, http://www.ubuntu.com/phone i think you can install anything on that like a LAMP server which includes PHP. Its a good choice because stuff like that is free. except for the device.

Categories