Is an iAMP setup possible? - php

I'd like to get apache, mysql, and php running in an iphone app. This is because I'm finding objective c to be quite difficult, and if I can get those three running and figure out how to set up a full-page browser or something, I can code my app like that.
The MySQL aspect isn't really a necessity since I can very easily code a flat file database in php for this.
Is this possible? Has it been done? If not, what frameworks should I use to make creating an app easier?

I am assuming what you are saying is that you are more familiar with HTML and JavaScript, and would like to code with those tools.
If so, take a look at PhoneGap and Titanium. They are frameworks to code iOS apps with web technologies. Basically, it is like running a local file in a web browser (with interfaces to access device functions such as the GPS). No need to have a PHP and Apache stack there.
There is also a quasi-standard to write web applications that can work offline once downloaded. Mobile Safari supports this, and it can almost look like a native app.

If you're looking for any other options, there's Mono Touch, which is C# for iPhone. It's garbage collected, managed, strongly typed, and has access to all the device functions just like PhoneGap.
There's not really any simple way to get PHP running on an iPhone. You could try to get it to compile yourself, but that sounds like you'd be spending more time trying to get the framework working rather than working on your actual project.

Related

Using tensorflow models in web applications

So I've recently became very interested in machine learning, and have been using tensorflow (python) in some of my projects at work.
However, I've now found a use for digit classification in one of my web projects which is all written in PHP for server-side code. Ideally, I'd like to be able to upload a picture via a Javascript interface, and on the PHP receiving end process the picture, slide a window to find the set of digits I'm looking for, and then process this through my trained neural network. I guess I'll summarise in one question: is this possible? Thank you!
Tensorflow provides serving project for communication, so you need to implement gRPC client for PHP, then use it to talk to Tensorflow serving environment.
That's how I work with Ruby and Tensorflow, it should be working for you as well!
You can try one of these PHP extensions:
https://github.com/absalomedia/tensile
https://github.com/wan2land/php-tensorflow

PHP: possible to compile a web-application into a windows application?

I have developed a PHP web application, but a client insists on a real Windows application, since he doesn't like running the software inside a browser.
Are there any solutions for this, any compilers to turn a web project into a Windows exe ?
I have looked at Phc-Win , but that seems more suited for small command line utils, not for entire web-applications...
UPDATE:
just found this myself, both look quite promising...
http://www.zzee.com/phpexe/
http://www.exeoutput.com/index.php
There's no tool for this, short of a simple wrapper app that embeds a browser inside an otherwise normal application window. Your PHP app would have to be completely re-written to include ALL of the overhead code necessary to build a GUI - basically all the 'display' stuff that a browser does automatically, would have to added to your app.
Well some of you did not google good enough:
http://www.appcelerator.com/products/titanium-cross-platform-application-development/
Supports most of the "web-languages" to write native Applications.
Tutorial Reference for Appcelerator: http://appceleratortitanium.com/tutorials/3-appcelerator-titanium-tutorial-beginners.html
Quote:
"Q: What languages can I use to make desktop apps?
A: Javascript, PHP, Python, Ruby, HTML, HTML5, and CSS."
Not exactly what you are looking for: http://www.roadsend.co/home/index.php?pageID=compiler
You may look into "HipHop" (made by Facebook): Converts PHP to compileable C++-
There's a tool for this. :-) I never used it but you can try this: Winbinder.
It is simple to compile your PHP source code into an executable. Facebook released a compiler for PHP in early-2010, called HipHop, which aims to create C++. You could then compile this code, for example using gcc, to machine-code.
The more difficult point for a complex Web-App like yours is the user interface. When compiling the way I described above, the application can be run from command line - this might work for simple tasks, but not, if your application returns HTML.
One possibility to solve this problem is PHP-GTK. PHP-GTK is a API for GTK (the graphical user interface used by Linux Ubuntu by default), written in PHP. Using this solution would have to read some documentation about this API, and you would need to rewrite some parts of your program, but it would probably be the most beautiful solution, because it would create a "native" experience.
Another possible solution could involve Adobe AIR, which lets your create programs for the desktop, using HTML, CSS and JavaScript, but I don't know if and how this would work together with your compiled PHP.
Please also note that it isn't absolutely necessary to compile your PHP for it to run on the client's computer; You could also ship the PHP-interperter right with your (uncompiled) PHP-script. Of course, compiling brings benefits, such as faster execution of the program.
-- André

Desktop Application with Flash and Php

I want to develop a desktop application using Adobe Flash remember a desktop not a web application. I want to connect Database (MySQL) to it for which I think I should use Php.
Can I send and receive data from Php files silently means without running the Php file itself.
Is there some method to achieve something like this?
Honestly it sounds like your best bet is going to be to use Adobe AIR. You can use the NativeProcess API to call PHP on the host computer, but you also have the option to use a SQLLite database directly from AIR with no need to mess with PHP.
Here's a link to a sample project with source code provided, this may help. Good luck!
http://www.peterelst.com/blog/2008/04/07/introduction-to-sqlite-in-adobe-air/
Is there some method to achieve something like this?
There are ways to package an Apache/PHP/mySQL environment into an executable, but they are terribly complex to set up and not especially light-weight.
You are probably much better off doing this on a native platform for desktop applications. Every major programming platform has the means to connect to a mySQL database - if that really is the database of choice for a desktop app.

php library iPhone

I'm wondering if anyone knows of a PHP library that I could compile into my app for the iPhone? Basically I'm wanting to allow the phone to display pages stored locally that have PHP in them and display them in a UIWebView.
Apple are extremely strict about not allowing 3rd-party code execution engines in apps, which would prohibit running a PHP interpreter.
If PHP is a true requirement, you'll have to host it on an external server and access the pages remotely.
Consider Javascript as an alternative language if you need to stay local, it's really the only way to execute run-time-generated code on the iPhone.
In order for that to work you would need:
A PHP compatible webserver running on your iPhone
Some sort of a PHP interpreter (not that there are so many different types of them out there) running on it too
I don't think this is/will be possible when thinking of Apple's strictness regarding 3rd party software and the low chances of someone even planning a port of PHP for the iPhone.
You mean like this PHP library? http://php.net/downloads.php
Running your debugged PHP code in an iOS app makes a lot of sense to me. Getting a PHP library in an iOS app and approved by Apple isn't easy, but it's been done. See: Running PHP on iOS? for details.

Flex with PHP

I'm new to Flex and done a few application with only client side programming. Now I'm trying to do the back-end stuff using PHP. Can some one explain where(which folder) to put the PHP file for the Flex file to communicate with PHP. I'm using Flexbuilder 3 IDE.
Thanks
Flex will not access your PHP script via the filesystem, you have to invoke your PHP script via a web server. The easiest solution is to use XML as in your data transport language. But you can get fancy and use something like BlazeDS
This all really depends on what you want. I would make a very different recommendation if you wanted to simply poll the server occasionally than if you wanted to have a regular interface between the two.
If you are simply polling the server, I would recommend simply using the HTTPRequest class. It will allow you to create POST and GET data and serve to communicate relatively well.
On the other hand, if you are looking to have a more complicated set of communications between the server and the SWF, your best bet is the RemoteObject class with either AMFPHP, WebOrb, or an equivalent (we use WebOrb where I work). This has the benefit of allowing you to have objects of similar name/type in both Flex and PHP, meaning that communication can be made a good deal more comprehensive.
(If you are working this way, email me cwATallen-poole.com and I can give some pointers so that you do not have insane compiler arguments for Flex).
The next option is to use the XMLSocket class, but that seems to be a bit more intense than what you are looking for.
You may want to take a look at AMFPHP too, pretty handy.
Try XAMPP.Very useful.
The new Flash Builder 4 (product formerly known as FlexBuilder) supports connecting to PHP services out of the box. The use the Zend Framework to do it, and will install the framework to your test webserver for you whenever you go to setup a data service.
Adobe video tutorials:
Part 1
Part 2
Another good, non-video tutorial

Categories