NoteWorthy Composer Forum

Forums => Tips & Tricks => User Tools => Topic started by: Robin P Withey on 2009-06-21 10:37 am

Title: User tools give errors with PHP 5
Post by: Robin P Withey on 2009-06-21 10:37 am
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
Title: Re: User tools give errors with PHP 5
Post by: Rick G. on 2009-06-21 11:36 am
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 (http://www.noteworthysoftware.com/nwc2/usertools/), 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:
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:
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.
Title: Re: User tools give errors with PHP 5
Post by: smoore33 on 2009-07-05 08:53 pm
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?
Title: Re: User tools give errors with PHP 5
Post by: Lawrie Pardy on 2009-07-06 04:49 am
I would:
Title: Re: User tools give errors with PHP 5
Post by: Rick G. on 2009-07-06 06:04 am
You might try this:

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
Title: Re: User tools give errors with PHP 5
Post by: Robin P Withey on 2009-08-04 07:58 pm
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
Title: Re: User tools give errors with PHP 5
Post by: smoore33 on 2009-08-10 12:23 am
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.

Title: Re: User tools give errors with PHP 5
Post by: smoore33 on 2009-08-10 12:41 am
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.
Title: Re: User tools give errors with PHP 5
Post by: Rick G. on 2009-08-10 01:02 pm
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 (https://forum.noteworthycomposer.com/?action=profile;u=11) 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:If not, perhaps you should reinstall the starter kit (http://www.noteworthysoftware.com/nwc2/usertools/).

The error described <here> (https://forum.noteworthycomposer.com/?topic=6848.msg47246#msg47246) 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 (https://forum.noteworthycomposer.com/?topic=6786.0).
Title: Re: User tools give errors with PHP 5
Post by: Robin P Withey on 2009-08-15 11:08 pm
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
Title: Re: User tools give errors with PHP 5
Post by: NoteWorthy Online on 2009-09-02 09:58 pm
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.
Title: Re: User tools give errors with PHP 5
Post by: NoteWorthy Online on 2009-10-02 01:36 pm
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 (https://forum.noteworthycomposer.com/?topic=5483.0). Sorry for the delay.
Title: Re: User tools give errors with PHP 5
Post by: smoore33 on 2009-11-08 08:26 pm
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.
Title: Re: User tools give errors with PHP 5
Post by: NoteWorthy Online on 2009-11-09 04:10 pm
New 1.5 starter kit is currently Beta 2: NWC2 User Tool Starter Kit 1.5 (Beta 2) (https://forum.noteworthycomposer.com/?topic=6975.0)
Title: Re: User tools give errors with PHP 5
Post by: smoore33 on 2010-03-15 08:10 pm
Is there now a version of PHP 5 for NWC 2 (or 2.1) that is out of beta?
Title: Re: User tools give errors with PHP 5
Post by: NoteWorthy Online on 2010-03-15 08:34 pm
Version 2.1 of the Starter Kit can be found here: NoteWorthy Composer 2 User Tools (http://ntworthy.com/nwc2/usertools/)
Title: Re: User tools give errors with PHP 5
Post by: smoore33 on 2011-01-02 12:40 am
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.
Title: Re: User tools give errors with PHP 5
Post by: Randy Williams on 2011-01-02 01:41 am
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
Title: Re: User tools give errors with PHP 5
Post by: rnathan on 2012-03-04 01:23 am
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.