I'm currently evaluating the Windows Azure platform. The situation is this: We have a couple of .NET-DLLs with functions which we would like to expose as webservices for our clients. Since all our webservice experience is in PHP though, we would love to just call the .NET-functions from PHP and handle the webstuff in PHP.
I know this is possible via COM or Phalanger. But is it also possible for PHP applications deployed on Windows Azure?
You can probably do this, but I think that the amount of effort in "fixing stuff to make it work" will be equal to just exposing everything as a .NET web service.
Related
Me and a friend are working on a C# windows application. He's in charge of designing the application, while I am in charge of the API.
I have created a DLL which will be used by the application for a majority of MySQL queries. I am also making a website to go along with the application and would like to make a smaller version of the app on the server (which is Linux, I should add) and have it run on the webpage.
So I am wondering if there is a way to call the methods from my DLL in a PHP page, or if I am better off just querying the database with PHP script or something of that nature.
You cannot use a Windows DLL on a Linux server. Maybe there's some way to hack stuff in with Wine... I'm not sure, but it's undoubtedly more hassle than it is worth.
You can use COM DLLs and .NET assemblies from within PHP. See the documentation: http://php.net/manual/en/book.com.php
If all you are doing is making MySQL queries, you are most certainly better off using PDO or MySQLi. This will simplify things greatly.
I would recommend having the DLL (I'd assume its a managed assembly) expose out REST or SOAP web services and consume those services via PHP.
Has anyone built one of these on a stock Windows Server 2008 r2 ? I only ask because JODConverter 3 doesn't seem to have the web services that v2 had, and the references ot getting them running talk about .jar files which don't seem to exist. If it can't be done using TomCat or something similar, it might be possible to construct a .php wrapper that calls the command line - but that option seems to defeat the purpose. Any ideas gratefully welcomed.
If you grab the read only from svn there is an example web application that you can compile with maven.
Executing the .jar from php using exec was unreliable at best when I tried it, it's not how it was intended to be used.
Here is an example php class someone made for use with a the web service method.
After fiddling around I've decided that a java application was the best route for us, but that is mainly due to restrictions of my project (not being allowed to run a TomCat server for example).
Google search results suggested that it's possible via PHP/Java Bridge . This bridge requires Java Application Server. My host (bluehost) does not allow to run any Java Application Server. What are the alternatives in this case to make iText work? Switching a host is not viable option for me.
Thanks.
I know this is an old post, but for those still looking for an answer, may I suggest having Java do your work for you as a REST service using Jersey (JAX-RS), then just call the service from PHP. You can put your Java service on a host that does allow Java and you can call that service from PHP using cURL (or even file_get_contents if your host allows it and if you know what you're doing).
Loose coupling over RESTful services is allows you to have your Java service and your PHP app on separate hosts. Don't waste you time with a PHP/Java Bridge. It's perfectly sane to call a RESTful service with a Java back-end from PHP. This way, later if you decide, your would rather re-do the service in C# or something else, at least there will be 0 impact on the PHP app because you used a language neutral RESTful approach.
I have not had any performance issues using this approach myself, YMMV
(It's mostly a matter of design: It's usually better to "bolt" things together then "weld" them together.)
Also, Java with JAX-RS is very very simple (IMHO, but again .. YMMV)
There's always iTextSharp, a C# translation of iText. Will your host let you run C#?
It looks like you can call C# from PHP, as detailed here.
The ITEXT website specifically says JAVA and .NET, Wish they can also build the PHP or PERL version
I have used the Java Itext, Its superb!!
PDFtk is a command line tool installed on many Linux systems. It is a front end to the iText library. It may do what you need. You'd have to shell out to the command line to invoke it from PHP.
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.
I'm curious if there are any SubSonic ports for use with php on a unix environment. I'm using SubSonic at work and I love it, and I'd like to create a MySQL database on a FreeBSD server and talk to it using php. I was hoping to use SubSonic again, but I'm not sure if there are any versions of it that work with php.
Are there any versions of this out there, or similar products to subsonic that work in php?
Unfortunately, I'm not aware of any direct ports of SubSonic to Unix. If you're not set on PHP, you could always try .NET running on Mono - that will give you SubSonic as is. Ruby on Rails is a second option - if I remember correctly, it served as inspiration for many of Subsonic's features.
If you're really set on PHP, you can always try Doctrine. I've never used it, but I've heard reasonable things about it. Propel is another option. If you're not opposed to full frameworks, I Symfony, CakePHP, and CodeIgniter all have some sort of ActiveRecord implementation.
SubSonic is definitly a .Net only project. I have used SubSonic with Mono to run a blog with a MySql back end on an OpenSuse Linux machine with Apache and found that SubSonic worked well. If you are stuck on PHP you could just create a webservice with Mono and SubSonic and then call your webservice from PHP or even from JSON if you set your web service up to handle JSON.