Skip to main content
Topic: User tools give errors with PHP 5 (Read 40827 times) previous topic - next topic

User tools give errors with PHP 5

Hi,

I haven't really tried using the user tools previously, but I decided it's about time I tried to do things the easy way, rather than the long, laborious, manual way.
The problem is, when I tried to use some of the tools (specifically Andrew Purdam's parts splitter), I got lots of errors (and I mean LOTS!), even though it actually worked in the end.
I'm pretty sure I know what the problem is: I have PHP 5 installed on my computer, and Noteworthy picks that in preference to the copy of PHP 3 that installs with the user tools. Now I don't want to uninstall that, as I do use it for work, so I was wondering if you had ever thought about upgrading the toolkit to work with PHP 5? I could do it myself, and will do if you don't already have a PHP 5-compatible version, but there's no point in re-inventing the wheel.

Robin Withey
Robin

Re: User tools give errors with PHP 5

Reply #1
I haven't really tried using the user tools previously, but I decided it's about time I tried to do things the easy way, rather than the long, laborious, manual way.
Hi Robin,

You started off the hard way. If you use the starter kit, it will install the old version of php where it won't interfere with PHP5. I know, I have PHP5, the last version of PHP4 and their ActiveX components as well as the User Tool version.

The invocation for GlobalMod starts with:
  • php\php.exe scripts\adp_GlobalMod.php
Note the relative path. When a user tool starts, its current folder is where nwc2.exe is.
To use the User Tool version, start with: php\php.exe

If you just invoke:
  • php.exe scripts\adp_GlobalMod.php
You will get the first version of php.exe in your path. (depending on how windows looks for apps on a particular day).

I agree that PHP5 is very nice. The problem is that it is huge by Noteworthy standards. Downloading 5 Megs to add fuctionality to a program that still fits on a floppy disk would seem a bit strange to the casual user.

That said, the COM support, ability to run as an ActiveX, pack, unpack, and gzuncompress are all quite useful.
Registered user since 1996

Re: User tools give errors with PHP 5

Reply #2
I am having the same problem.  I purchased an update to NWC version 2 and did a fresh install on my new laptop, which did install php in a folder under NWC.  I also have an installation of PHP5 at C:\php, so user tools don't run.  What would you recommend?  Is it necessary to download and reinstall using the starter kit?  Is there a way to tell NWC's user tools where to find its copy of php?

Re: User tools give errors with PHP 5

Reply #3
I would:
  • Make sure that php.exe is actually in the php folder under the NWC2 folder
  • Make sure that command lines calling php in usertools are literally "php\php.exe usertoolscriptname.php" - without the quotes of coures...
  • Check to see if the php5 directory: C:\PHP is in you system's "path" variable and if so consider if it is practical to remove it
  • Make sure the tools you are trying to run are, in fact, written in php - some tools are written in other languages, including VBScript
I plays 'Bones, crumpets, coronets, floosgals, youfonymums 'n tubies.

 

Re: User tools give errors with PHP 5

Reply #4
You might try this:
  • Make sure that php.exe, php4ts.dll and php.ini exist in:
    C:\Program Files\NoteWorthy Software\NoteWorthy Composer 2\PHP
  • Both php.exe and php4ts.dll versions should be: 4.3.9.9
    php.ini should look like this:
    Quote from: php.ini
    [PHP]
    error_reporting  =  E_ALL | E_STRICT
    display_errors = On
    display_startup_errors = On
  • Search... for all files named: php.
  • Rename all copies of php.exe and php.ini to: php.exe.bak and php.ini.bak, except those in:
    C:\Program Files\NoteWorthy Software\NoteWorthy Composer 2\PHP
  • Try a User Tool (I'd start with: Statistics (nwsw))

If you get: Command process failed, then the User Tool Command line is wrong.
For Statistics (nwsw), it should be: php\php.exe scripts\nwsw_StatisticsReport.php
Registered user since 1996

Re: User tools give errors with PHP 5

Reply #5
Hi,

First of all, my apologies for not acknowledging your replies earlier. I posted this question, then completely forgot I'd done it, as I'd finished the score I was editing the hard way, and I haven't had a need to use NWC for a while. So thanks for all your replies.

Secondly, I don't think anyone's come up with the right answer. Maybe it's not PHP 5 after all. I did install the starter kit, and the user tools do show php\php.exe etc. The error I get, time after time, is, hopefully, attached. Anyone any idea whether it's because it's the wrong version of PHP, or do I need to play with the ini files, or what?

In case I forget to come back again, thanks in advance!

Robin Withey
Robin

Re: User tools give errors with PHP 5

Reply #6
I get the exact  same error under the same conditions (php5 also installed with NWC2).  I have verified:

1. php.exe is actually in the php folder under the NWC2 folder
2. command lines calling php in usertools are "php\php.exe scripts\usertoolscriptname.php"
  (I also tried C:\Program Files\Noteworthy Software\NoteWorthy Composer 2\php\php.exe scripts\adp_Ranges.php)
3. the tool I am trying to run, Ranges (adp), is written in php

Removing php5 from the path temporarily generates a php5 error about missing dlls; it does not cause NWC2 to find its own copy of php.  I can not delete or disable php5 to get NWC2 scripts to work.  Does anyone have a solution?  Thanks.


Re: User tools give errors with PHP 5

Reply #7
I just tried running the script adp_Ranges.php by Andrew Purdam using php5 in c:\php.  It ran without errors, but deleted all notes in the staff, instead of giving the maxima and minima for the staff.  If we can't get a solution for how to get NWC2 to use its own older copy of php, maybe somebody knows the authors of the scripts and they could (easily, one would hope) modify them to work with php5.

Re: User tools give errors with PHP 5

Reply #8
If we can't get a solution for how to get NWC2 to use its own older copy of php, maybe somebody knows the authors of the scripts and they could (easily, one would hope) modify them to work with php5.
I don't know what the author of adp_Ranges.php could do to help. On my Win98SE box, adp_Ranges.php runs just fine with php versions 4.3.9.9, 4.4.9.9 and 5.2.8.8
This would strongly suggest that the tool is compatable with all versions and that your php configuration/installation is at fault.

To reiterate:
  • Make sure that php.exe, php4ts.dll and php.ini exist in:
    C:\Program Files\NoteWorthy Software\NoteWorthy Composer 2\PHP
  • Both php.exe and php4ts.dll versions should be: 4.3.9.9
    php.ini should look like this:
    Quote from: php.ini
    [PHP]
    error_reporting  =  E_ALL | E_STRICT
    display_errors = On
    display_startup_errors = On
  • For "NWC2 User Tool Starter Kit - Version 1.22", File sizes and dates should be:
    PHP4TSDLL851,96810-19-04  7:01a
    PHPEXE24,57610-19-04  7:01a
If not, perhaps you should reinstall the starter kit.

The error described <here> might be a situation where php.exe is coming from one folder, but Windows is looking elsewhere for php4ts.dll. If you rename any copies of php4ts.dll to, e.g., php4ts.dll.bak, you should be able to isolate this problem. Another possibility is that Windows is using some copy of php.ini that is asking php to load incompatable modules (dll's). Renaming stray copies of php.ini may help.

If you actually need the information that adp_Ranges.php provides, you might try ambit.vbs.
Registered user since 1996

Re: User tools give errors with PHP 5

Reply #9
I checked, and the PHP files in NWC were exactly as required. I also checked that there was exactly one copy of php4ts.dll.

However, I did confirm that the problem is with PHP 5: I removed it, and the problem went away. I don't often use PHP for work, so I'm not that bothered about removing it.

I might try and reproduce the problem later on, but not until sometime after 22nd October, when I take the plunge and reinstall everything under Windows 7 (64-bit). Then I'm sure I'll find all sorts of new problems!

Thanks for checking things out.

Robin Withey
Robin

Re: User tools give errors with PHP 5

Reply #10
I have been trying to diagnose this problem. Given some of the issues that have come into our support, I would guess that the problem is that the NWC2 starter kit version of PHP is picking up the "php.ini" that you use for your other PHP installation, and this incompatible extensions are trying to be loaded. For now, the fix is probably to alter your user tool invocations so that they use your system copy of PHP, or explicitly reference the NWC2 "php.ini" file in the NWC2 starter kit's PHP invocation.

We will be updating the NWC2 User Tool Starter Kit later this month to PHP5, so this should also help. The 'nwc2clips.inc' api will also be significantly enhanced in the next release, as it will include a NWC2PlayContext class for simulating the NWC2 play back engine.

Re: User tools give errors with PHP 5

Reply #11
A beta of the new version 1.5 starter kit, which includes PHP5, is currently available in the Back Stage forum area. This area is available to those that have upgraded their membership. Sorry for the delay.

Re: User tools give errors with PHP 5

Reply #12
Are the fixes mentioned on September 2, 2009 available yet?  Is the version of the tools that uses PHP5 publicly available now?  (I have a purchased and registered copy, but didn't complete the forum "upgrade" process.)  Thanks.


Re: User tools give errors with PHP 5

Reply #14
Is there now a version of PHP 5 for NWC 2 (or 2.1) that is out of beta?


Re: User tools give errors with PHP 5

Reply #16
I still can not get User Tools to work.  I am running XP SP3 with a copy of PHP 5.2.8.8 installed at C:\PHP.  I have NWC 2.1 and just downloaded and installed the latest User Tools Starter Kit today.  When I try to run Ranges (adp), command: php\php.exe scripts\adp_Ranges.php <PROMPT:Enter your range option:=|none|separate|help>, I get the following error:

PHP Warning:  PHP Startup: mssql: Unable to initialize module
Module compiled with module API=20060613
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0

My copy of PHP at C:\PHP seems to run fine.  Any suggestions?  Thanks.

Re: User tools give errors with PHP 5

Reply #17
It seems you may have privately downloaded your own version of PHP, rather than using the version automatically installed by the user tool kit?  If so, I have had a wide variety of problems trying to do this myself, although not the particular problem you are seeing.  I had to do a bit of "uninstalling" the PHP I privately downloaded, before I could get NWC's PHP working again (particularly with regard to wxWidgets support).  HTH, Randy

Re: User tools give errors with PHP 5

Reply #18
The advice in this thread was helpful. I run Windows 7 Home Premium.

I upgraded to NWC v2.5, and downloaded the User Tool Starter v2.5, but this was not enough, as I had another version of PHP (used for web authoring). One workaround was to rename the PHP folder in Program Files (x86) to "PHP disabled".

My eventual solution was to remove the other version of PHP altogether using Windows Control Panel, then manually delete the PHP.ini file that was still on disk. I could do this, because the PHP that comes with NWC is suitable for my web authoring application (so long as the new location of the PHP executable, C:\Program Files (x86)\Noteworthy Software\NoteWorthy Composer 2\PHP\php.exe, is set in preferences).

Best regards, Roger Nathan.