1

I found a very good example of how to wrap C++ code for using in PHP code. This is for PHP5 and it works for me.

How do I need to modify this example to use PHP4 (4.4.9-pl0-gentoo) instead? So that the example works calling php4 instead php (with the latter pointing to php5)?

I also tried to 'copy' the created vehicles.so library into the PHP4 library directory, but php4 seem to ignore this library. Could there be anything done about that? Or do I have just to compile the code with php4? (Not sure if the sentence makes sense, as I only compile C++ code.)

Alex
  • 41,580
  • 88
  • 260
  • 469
  • 2
    I would suggest upgrading to a recent PHP5. PHP4 is unmaintained.... – Basile Starynkevitch Sep 05 '13 at 15:58
  • 1
    I have to do this in PHP4. Or to estimate the required work to do this in PHP4. Alternatively, you are welcome to upgrade 300000 lines of code from PHP4 to PHP5! If you can manage this within a week that would be preferable... – Alex Sep 05 '13 at 16:00
  • I haven't looked at it recently, but is there really that much that has changed from PHP4 to PHP5 that isn't backwards compatible? I seem to remember that we moved the site I work on from PHP4 to PHP5 without much of an issue. – Mats Petersson Sep 05 '13 at 16:27
  • This is the list of "known imcompatibilities": http://www.php.net/manual/en/migration5.incompatible.php – Mats Petersson Sep 05 '13 at 16:28
  • You have to compile the code with PHP 4 to match the API version. However, upgrading to PHP 5 looks like a better option to me. You will likely not find good support nowadays for PHP 4 extension development, no-one will have some interest to do that together with you (most likely). It's easier to get support migrating from PHP 4 to PHP 5. – hakre Sep 08 '13 at 16:56

0 Answers0