- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: OpenVMS style filename problem with PHP
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2006 02:08 AM
12-07-2006 02:08 AM
OpenVMS style filename problem with PHP
CSWS Apache V2.1 and PHP V1.3.
The prior version the system (Apache V1.3 and PHP V1.1) allowed us to use
OpenVMS style file names in PHP scripts that created files (using the PHP
"fopen" command).
This PHP statement that worked in the prior version now aborts:
$outfile = fopen ("dga38:[phptest]php_test.dat", "w");
with this error message:
Warning: fopen(dga38:[phptest]php_test.dat): failed to open stream: i/o error
If I change the statement to be more UNIX like and remove the VMS square
brackets and colons, like this:
$outfile = fopen ("/dga38/phptest/php_test.dat", "w");
the PHP script will now work.
I do not see any setup/configuration docs that address this issue. I have
added "extension=php_openvms.exe" to our PHP.INI file, but that did not help
(Does anyone know what that extension does do?).
Has anyone else seen this behavior? Is there a way to configure the system
to recognize the VMS type file names? Any assistance or suggestions would
be appreciated...
im
Ira Melamed
Administrative Computing
Farmingdale State
Farmingdale, New York 11735
Email: melameis@farmingdale.edu
Phone: (631) 420-2415
Fax : (631) 420-2696
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2006 04:54 AM
12-07-2006 04:54 AM
Re: OpenVMS style filename problem with PHP
The Openvms extension is demonstrated by the PHP_OPENVMS.PHP script (see installation guide).
regards Kalle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2006 05:57 AM
12-07-2006 05:57 AM
Re: OpenVMS style filename problem with PHP
There are indeed lots of logical name to influence behaviour.
Full list:
http://h71000.www7.hp.com/commercial/c/docs/5763pro_003.html#feature_logical_tab
The next page has explanations.
Check out: SYS$POSIX_ROOT and DECC$FILENAME_UNIX_REPORT and such/
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2006 07:52 AM
12-07-2006 07:52 AM
Re: OpenVMS style filename problem with PHP
You could, however, try
$ DEFINE DECC$FILE_NAME_UNIX_ONLY DISABLE
in the environment where your PHP script will run and see if that makes any difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2006 07:58 AM
12-07-2006 07:58 AM
Re: OpenVMS style filename problem with PHP
Craig wrote
>>>You could, however, try
$ DEFINE DECC$FILE_NAME_UNIX_ONLY DISABLE
<<<
... and if somehow PHP manages to re-define it, you MIGHT even try to add /NOALIAS to the DEFINE.
As always, no guarantee, but the thing I would also try.
Just my EUR 0,02
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2006 08:00 AM
12-07-2006 08:00 AM
Re: OpenVMS style filename problem with PHP
just noted you joined the Forums today, and this is your first question, so:
WELCOME to the VMS forum!
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2006 02:04 PM
12-07-2006 02:04 PM
Re: OpenVMS style filename problem with PHP
settings (like DECC$FILE_NAME_UNIX_ONLY),
then I wouldn't hold out much hope for a
logical name definition (no matter how fancy)
changing anything. As can be seen in any of
the stuff I've worked on in recent years,
these features may be controlled (enabled or
disabled) inside a program using the
decc$feature_set_value() function (and its
friends). The CRTL feature logical names set
default values, but the program can override
anything external.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2006 07:48 PM
12-07-2006 07:48 PM
Re: OpenVMS style filename problem with PHP
I would personally use the filename translation function OPENVMS_CVT_... :-
#
# Test the OpenVMS convert filename function
#
# openvms_cvt_filename (func_code, file_name)
#
# func_codes:
# OPENVMS_CVT_VMS_TO_UNIX Convert vms filespec to unix filespec
# OPENVMS_CVT_UNIX_TO_VMS Convert unix filespec to vms filespec
#
$VmsFn = "PHP_ROOT:[SCRIPTS]PHP_OPENVMS.PHP";
$UnixFn = openvms_cvt_filename (OPENVMS_CVT_VMS_TO_UNIX, $VmsFn);
if ($UnixFn === FALSE)
echo "openvms_cvt_filename (OPENVMS_CVT_VMS_TO_UNIX, \"$VmsFn\") = " . openvms_message (openvms_status ()) . "
\n";
else
echo "openvms_cvt_filename (OPENVMS_CVT_VMS_TO_UNIX, \"$VmsFn\") = $UnixFn
\n";
#
Robert.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2006 08:39 AM
12-08-2006 08:39 AM
Re: OpenVMS style filename problem with PHP
I have tried two suggested fixes/work-arounds. I think I am able to get the
results I need using the second suggestion.
First, I tried setting the DECC$FILE_NAME_UNIX_ONLY logical, but it had no
positive effect on my .PHP script. I placed the following lines in the
APACHE$WWW users LOGIN.COM and stop/started the server:
$ SET VERIFY
$ SHOW LOG DECC*
$ DEFINE DECC$FILE_NAME_UNIX_ONLY DISABLE
$ SHOW LOG DECC*
$ SET NOVERIFY
The following appeared in the various APACHE$SWS*.LOG'S, and seems to me to
indicate the logical was set as expected:
$ SHOW LOG DECC*
(LNM$SYSTEM_TABLE)
"DECC$CRTLMAP" = "SYS$SHARE:DECC$SHR_EV56"
"DECC$SHR" = "SYS$SHARE:DECC$SHR_EV56"
(DECW$LOGICAL_NAMES)
$ DEFINE DECC$FILE_NAME_UNIX_ONLY DISABLE
$ SHOW LOG DECC*
(LNM$PROCESS_TABLE)
"DECC$FILE_NAME_UNIX_ONLY" = "DISABLE"
(LNM$SYSTEM_TABLE)
"DECC$CRTLMAP" = "SYS$SHARE:DECC$SHR_EV56"
"DECC$SHR" = "SYS$SHARE:DECC$SHR_EV56"
$ SET NOVERIFY
As I said, my original .PHP scripts still failed.
The second test - ran the sample code to execute the OPENVMS_CVT_VMS_TO_UNIX
and OPENVMS_CVT_UNIX_TO_VMS functions. The output of this test displayed:
openvms_cvt_filename (OPENVMS_CVT_VMS_TO_UNIX,
"PHP_ROOT:[SCRIPTS]PHP_OPENVMS.PHP") = /php_root/scripts/php_openvms.php
and translated the VMS file name to a UNIX style file name...and the reverse
function OPENVMS_CVT_UNIX_TO_VMS worked also.
So I guess I need to re-write my scripts to open/close files using UNIX style
file names and when I need access to the VMS style name use the function
OPENVMS_CVT_UNIX_TO_VMS. Maybe something like:
$unix_style = "/dga38/iratest/ira_test.dat";
$out_file = fopen ($unix_style, "w");
$vms_style = openvms_cvt_filename (OPENVMS_CVT_UNIX_TO_VMS, $unix_style);
It still seems a little odd to me that PHP on VMS can not handle the native
file format, but at least we understand a little of what is going on and
can deal with it.
Thanks again to all those who commented...
im
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2006 08:54 AM
12-08-2006 08:54 AM
Re: OpenVMS style filename problem with PHP
> on VMS can not handle the native file
> format, [...]
It probably shouldn't seem odd. There's a
lot of UNIX-oriented code out there which
expects, for example, to parse a path name by
finding the slashes. This sort of code can
deal with UNIX-format file specifications
only. In such cases, telling the VMS C RTL
to use only UNIX-format file specifications
is much easier than re-writing a lot of the
code, especially when that code is subject to
frequent changes, and when getting
VMS-specific changes added to the official
code distribution is difficult.
If PHP had been developed on VMS instead, the
situation might be different.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2006 07:58 PM
12-10-2006 07:58 PM
Re: OpenVMS style filename problem with PHP
Wim