Click to See Complete Forum and Search --> : PHP and Perl Modules


adavis
03-14-2006, 05:27 PM
I have started on a new project. All apps up to this point have been written in Perl. The direction is to start phasing out Perl coding and start coding all new apps in PHP. There are a boat load of already written, already working Perl Modules (modulename.pm), i.e. a bunch of user written functions customized to this project.

Does anyone know what I need to do to be able to call those modules and use them as if they were written in php. The biggest thing I need to do at this point is to connect to the database. They have all that embedded so deep that I have been unsuccessful in trying to locate the passwords. I know they work because they work for the Perl scripts. I think the passwords are in a hidden file that I cannot get to.

I think there is switch that needs to be changed in the ini file and then php will have to be recompiled. They sysadmin is really dragging her feet about doing this because she will have to take the server down, which means coming in on a weekend.

Is there any other way around this, like a wrapper of some sort. I wouldn't know where to start, but if someone has any ideas, I'd sure like to hear them. I certainly don't want to have to rewrite about 50 modules that average about 200 lines of perl code.

bubblenut
03-14-2006, 06:51 PM
Check out http://pecl.php.net/package/perl, I've not used it before, nor heard of anyone elses experiences but it looks like it could be helpfull.

dream.scape
03-14-2006, 07:24 PM
I think there is switch that needs to be changed in the ini file and then php will have to be recompiled. They sysadmin is really dragging her feet about doing this because she will have to take the server down, which means coming in on a weekend.

lol... I got a good laugh when I read that, because it really is true for many people... we'll put off doing something for weeks on end that only will actually take a small amount of time when we get around to it, just because we don't feel like getting it over with. In this case, if you want to compile the PECL extension into PHP, it would only take about the length of time it takes to compile PHP, which isn't that long, or even less time if you wanted to compile the PECL extension separately and load it when PHP starts up... heck now you can install PECL extensions with PEAR now, so all you'd really need to do is issue "pear install perl" or whatever the official PECL package name is.

adavis
03-15-2006, 11:48 AM
I may have already sent her that link about a month or so ago when this first came up.

Pulling the servers off line during the week (or at least 6am to 6pm) is a major deal, even if for only a few minutes. I live 15 minutes from work. She lives about an 1.5 hours from work, so coming in on the weekend for 10-15 minutes is a 3+ hour time commitment from her. Hanging around an extra hour or so is probably the best bet.

I just need it done soon because I'm getting to the point where I need to get off my local machine and move over and start testing on a live server.

dalecosp
03-15-2006, 12:07 PM
Anyone for "Remote Access?"

dream.scape
03-15-2006, 12:32 PM
yes really why does she have to physically be at the server? never heard of SSH?

You also don't need to go offline. While re-compiling PHP, you won't harm any live systems aside from maybe using a little CPU. It doesn't install then until you issue "make install". And PHP is pretty smart about installing itself. At most you might have to restart Apache, which would mean a whopping 1/4 second of downtime.

Both of you seem to mistakenly believe that to recompile PHP you have to take the current PHP installation & Apache offline, which is utterly false.

adavis
03-16-2006, 10:21 AM
I'm not a server person, so I didn't know that she could do it remotely. Yes, she has remote access. I also didn't realize she could recompile PHP and leave the server up. I'm hoping that she does it soon though. I was really supposed to deliver the app yesterday (15th), but now can wait 'till the 1st. The app is complete except for accessing remote databases. I'm running at localhost right now and accessing dummy tables on my local machine and everything is working. I about 95% confident that it's ready to go live once I get remote access. You know how it is though, never say 100% until you see it working on the live server. Don't ask why it's so hard to get access. I just is. I just keep my head down and keep coloring. ;)