SubSonic ports for unix use? - php

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.

Related

Is it possible to call a method from a DLL on a PHP webpage?

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.

Best PHP search technique for heavy database like apache solr for java

I have used apache solr in my java project smoothly, but when i come to the end to solve a same kind of issue with PHP, this issue is arising:
To run apache SOLR, we need JVM to be installed on the server. But I don't know whether there is JVM installed in my client server or not. Because it is PHP apache linux server (not dedicated), I don't know whether I will get to access the console by which I can manage a bit.
Could any body tell me what is the alternative for apache solr for simple PHP environment?
Or please suggest me best indexing search technique for PHP.
Some options:
The worst solution, but probably the easiest if you want to remain in this (shared?) environment is to use a php solution like aitchnyu suggested. You could even use your own.
Shared environments often have access to mysql, you could search based off that. (Also not ideal, but possible)
Upgrade servers to like a virtual-shared server or use a seperate server for SOLR (I use ec2 free-tier which works well)
Not really an option but to answer your question, yes you can access the terminal through php but this is far from what you should really do because most shared servers disable access through php (in fact they didn't give you ssh access for a reason).
Also because even if they forgot to close this security hole (which happens sometimes) you will exhaust your resources (ram, cpu) pretty quick and you'll have to upgrade servers anyway.

How to use iText java PDF library with PHP?

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.

Can I call .NET-functions from PHP on Windows Azure?

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.

Connect PHP to IBM i (AS/400)

I've got an upcoming project wherein I will need to connect our website (PHP5/Apache 1.3/OpenBSD 4.1) to our back-end system running on an iSeries with OS400 V5R3 so that I can access some tables stored there. I've done some checking around but am running into some roadblocks.
From what I've seen the DB2 extensions and DB2 software from IBM only run under Linux. I've tried compiling the extensions with all the software from IBM and even tried their precompiled ibm_db2 extension with no luck. IBM only supports Linux so I turned on the Linux emulation in the kernel but that didn't seem to help anything.
If anyone has run across getting everything to run natively under OpenBSD that would be great, but what I think I may have to do is setting up a second server running CentOS with DB2 installed (most likely via ZendCore for IBM since it seems to do all this for me) and the driver so that I can set up a small transaction server that I can post against and get a JSON representation of the DB2 data that I need.
Does the second option seem overkill or does anyone else have any better ideas?
Have you looked at connecting to the server using unixODBC? If I remember correctly it has support for IBM DB2 and compiles on OpenBSD. Check out http://www.php.net/odbc for more information regarding the PHP side.
If you can't get that to work, the option to setup a web service on a Linux server may be all you can do.
Rather than setup a 2nd box, why don't you look into the PHP Connector for iSeries? My mainframe guys said it was very easy to setup on our iSeries here.
We wrote a simple server in PHP that loads data models from DB2 data, serializes them, and returns them to the caller. This approach means that only another PHP app can consume the service but it's just so much quicker on both ends to just serialize the object and send it down the pipe.
Here is a PDF from IBM on the subject: http://i-seriesusergroup.org/wp-content/uploads/2006/09/PHP%20for%20i5OS%20NESDND.pdf
To second #John Downey, I've gotten connectivity to work with PHP on an AS/400 with unixODBC.
Check your phpinfo() to see if unixODBC is available in it. I didn't have to compile it in on SLES 10.
Looks like a web service is going to be the answer for me. On a production box I'd rather not have to go through compiling and maintaining my own special installation of PHP since ODBC support needs to be compiled in, according to the PHP documentation.
A web service is almost certainly the way to go. I'm sure you've already thought of this, but since you're doing PHP on both sides, you can shortcut things a little bit by using serialize() to build your response data instead of building a proper XML document. It's less flexible over the long run, but it will probably get you up and running more quickly.
Indeed, a webservice seems like a great way to solve the problem. One way to avoid having a completely separate OS for it would be to write the webservice in Java on top of the AS400 tools for Java (which are quite nice, btw). That should at least let you run your service layer on the OpenBSD box as well.
You can connect directly using a standard ODBC driver as well. The IBM version usually gives you more features like being able to call programs and things like that. If you only need SQL and stored procedures, ODBC should work.
Why not use PDO from PHP? I have to guess here since I could not find a public list of all ports available for OpenBSD, but since there is a port for FreeBSD, NetBSD etc. maybe you get lucky as well.
(I guess that even though OpenBSD links to FreeBSD's porter's handbook, Freshports is not applicable for your system?)
If PDO is not available and since I am hoping you use ports and according to the following link there is php5-ODBC available:
http://www.openbsd.org/pkg-stable40.html
So assuming you manage your system through ports, there are your pointers.
Hope that helps!

Categories