Author Topic: Web/2 and PHP5  (Read 2847 times)

Jean-Yves

  • Jr. Member
  • **
  • Thank You
  • -Given: 17
  • -Receive: 1
  • Posts: 81
    • View Profile
    • shimeril.com
Web/2 and PHP5
« on: September 10, 2014, 04:23:28 pm »
Firstly, hello everyone.  I've been following these forums for years (I believe that I may have had another login at some point in the dim and distant past but I've no idea whether I posted or not)

I used to be a major OS/2 and eCS fan until the delights of OS X drew me away. (Sorry! :) )

I recently got a major nostalgia rush and decided to install eCS (1.2MR) on an old Dell laptop. Well, eCS installed but I could not get networking to work at all so I had to abandon that. I have however managed to install it onto VirtualBox and all is working nicely.

Now, I'd like to get Web/2 (WEB2BETA4 file from hobbes) and PHP (php5.exe CGI version from Paul Smedley's site) working together

I know that this should work - others seem to have succeeded and I remember that the last time I had eCS installed I had the same setup working (with PHP4 at the time)

I have copied the php.exe file into the cgi-bin folder and written a very basic test file, phpinfo.php that I have popped into the html folder:

Code: [Select]
<?php
   phpinfo
();

However, when I open the file in either Netscape or Mozilla (I have not got around to getting Firefox installed - that's another story! ) nothing happens: Mozilla reloads the current page (directory listing) immediately, whilst Netscape states that there was an empty response.

When I place Web/2's sample cgi examples into the two folders, these work fine.

Anyone got any ideas what I am doing wrong?

Thanks in advance for any help :)



Sergey Posokhov

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 5
  • Posts: 103
    • View Profile
    • OS/2 API Research
Re: Web/2 and PHP5
« Reply #1 on: September 10, 2014, 04:39:42 pm »
You should use php-cgi.exe instead of php.exe,
You should place PHP.ini to "C:\MPTN\ETC" (see ETC=... variable in Config.sys),
There were some bugs with image loading (Web/2 and PHP5 should be situated on the same drive as your project),
Add error handler and time zone function call (see examples),
Don't forget to check "short_open_tag" option in PHP.ini,
Increase "output_buffering" to 256K...

...or switch to Scala, Erlang, C+=2011, Modula-2 or other serious programming language. There is no salary around PHP.
« Last Edit: September 10, 2014, 04:42:49 pm by Sergey Posokhov »

Jean-Yves

  • Jr. Member
  • **
  • Thank You
  • -Given: 17
  • -Receive: 1
  • Posts: 81
    • View Profile
    • shimeril.com
Re: Web/2 and PHP5
« Reply #2 on: September 10, 2014, 04:53:15 pm »
Hi there,

Many thanks for the pointers - I'll try you tips out tonight :)

As for using one of those other languages, none of the ones you mention are really ideal for web development from a portability perspective I'd say. For example, I don't know of Apache or nginx modules for erlang or scala, but I could be wrong as I've never even considered looking for them!

I like PHP though: I've built enterprise systems in it used by both the UK government and various EU bodies, numerous large corporates, my own online game etc, so I reckon it can stand the test ;)  Yeah it's riddled with inconsistencies and has gotchas at every turn for the unwary, but it's perfectly usable if you know what you're doing (been using it almost daily for I think over 10 years now)

Erlang and Scala I don't really know well at all (although I am currently reading a book designed for OO developers to get the hang a functional programming) and I've never used Modula2 although I did use Pascal quite a bit in the very distant past (I even got 100% in my pascal exams. The one and only time I ever scored 100% in a formal exam :D )

I did look at erlang a little when I was doing some work on a Riak NoSQL storage layer for a system a few months back. Brain hurt!!!  Riak itself was easy enough to set up and interact with via its APIs though.

Smalltalk was the language I loved most - I used to build banking programs in Digitalk Visual Smalltalk for OS/2 a long time ago.

(Edit: fixed some typos)
« Last Edit: October 13, 2014, 10:30:36 am by Jean-Yves »

Jean-Yves

  • Jr. Member
  • **
  • Thank You
  • -Given: 17
  • -Receive: 1
  • Posts: 81
    • View Profile
    • shimeril.com
Re: Web/2 and PHP5
« Reply #3 on: September 11, 2014, 04:12:57 pm »
No luck. I even removed web/2 and reinstalled it, then I copied the php.exe from the PHP 5.2 archive and tried that, then copied the php_cgi.exe (which is what I meant by the php.exe before, I got the name wrong, sorry) from PHP5.5 and tried that, having amended the cgi config file and restarted web/2

Bizarre.

I'll probably have to go down the Apache route ans see whether that works. 

Sergey Posokhov

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 5
  • Posts: 103
    • View Profile
    • OS/2 API Research
Re: Web/2 and PHP5
« Reply #4 on: September 11, 2014, 05:53:18 pm »
Quote
I have copied the php.exe file into the cgi-bin folder...
I used to leave it into "C:\Programs\PHP5\CGI", then edit PATH and LIBPATH in Config.sys, then edit Web/2 config file.
PHP's own config file, PHP.ini, should be situated in "ETC" directory.

Jean-Yves

  • Jr. Member
  • **
  • Thank You
  • -Given: 17
  • -Receive: 1
  • Posts: 81
    • View Profile
    • shimeril.com
Re: Web/2 and PHP5
« Reply #5 on: September 12, 2014, 12:25:07 pm »
OK, I'll try that.

Many thanks, I really appreciate you taking the time to help out.