The British Caving Association
http://british-caving.org.uk/phpBB3/

PHP DIO module
http://british-caving.org.uk/phpBB3/viewtopic.php?f=31&t=1493
Page 1 of 1

Author:  David Gibson [ Sat 07 Jul 2018 11:43 ]
Post subject:  PHP DIO module

I want to use PHP's Direct IO functions (http://php.net/manual/en/book.dio.php ) on my local PC. So I have downloaded it from PECL (https://pecl.php.net/package/dio/0.1.0) but Im having problems installing it. I wondered if anyone has any experience of installing PEAR packages under XAMPP on Windows 10? Essentially, I think the problem is that my installation of XAMPP possibly has some paths that PEAR is not expecting - or is it something more subtle? When I try to install the package I get ERROR: failed to mkdir C:\php\pear\tests\dio\tests. There are some hints in various onlin esupport groups about changing some of XAMPP's paths, but I thought Id ask here first before wading my way through them all.

Details of what I did are as follows.

Firstly, I ran the following tests - as suggested at http://pear.php.net/manual/en/installation.checking.php.

Installation meets the dependency requirements? (yes)
Code:
C:\xampp\php> pear version
PEAR Version: 1.10.1
PHP Version: 5.6.15
Zend Engine Version: 2.6.0
Running on: Windows NT RED-LAPTOP 10.0 build 16299 (Windows 10) i586

Location of config file...
Code:
C:\xampp\php> php --ini
Configuration File (php.ini) Path: C:\WINDOWS
Loaded Configuration File:         C:\xampp\php\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

Ran phpinfo() from web server, to see what the web server thought was happening...
Code:
Configuration File (php.ini) Path   C:\WINDOWS
Loaded Configuration File           C:\xampp\php\php.ini
include_path                        C:\xampp\php\PEAR

Checked PHP's include_path setting on the command line:
Code:
C:\xampp\php> php -c php.ini -r "echo get_include_path();"
C:\xampp\php\PEAR

Created a file (which I named as check_pear.php) containing...
Code:
<?php require_once 'System.php'; var_dump(class_exists('System', false)); ?>

and ran it from my localhost browser, producing an output of bool(true), which is correct. Also ran it from the command line and got the same answer...
Code:
C:\xampp\php> php C:\ [...] public_html\check_pear.php
bool(true)


Next, I installed the package, resulting in ERROR: failed to mkdir C:\php\pear\tests\dio\tests
Code:
C:\xampp\php> pear install dio
No releases available for package "pear.php.net/dio" - package pecl/dio can be installed with "pecl install dio"
install failed

C:\xampp\php> pecl install dio
Failed to download pecl/dio within preferred state "stable", latest release is version 0.1.0, stability "beta", use "channel://pecl.php.net/dio-0.1.0" to install
install failed

C:\xampp\php> pear install channel://pecl.php.net/dio-0.1.0
downloading dio-0.1.0.tgz ...
Starting to download dio-0.1.0.tgz (36,960 bytes)
..........done: 36,960 bytes
ERROR: failed to mkdir C:\php\pear\tests\dio\tests

Author:  David Cooke [ Sat 07 Jul 2018 13:22 ]
Post subject:  Re: PHP DIO module

No direct experience.

Have you checked the process has permission to create that directory?

Try manually creating the directory for the process and see if that helps.

Author:  David Gibson [ Sun 08 Jul 2018 13:00 ]
Post subject:  Re: PHP DIO module

David Cooke wrote:
Have you checked the process has permission to create that directory?


Well, I wondered about that, but this is Windows we're talking about, so can permissions be an issue? But I will try what you suggested.

Although... perhaps permissions can be an issue after all? In an unrelated exercise, Im trying to install one very old piece of software to run with another very old piece of software (in Windows 10) and I get an error message something like "process needs to be elevated". So I tried holding my laptop up in the air, but it still didnt work. I think its saying that one or the other program needs admin privileges.

Author:  David Cooke [ Sun 08 Jul 2018 13:31 ]
Post subject:  Re: PHP DIO module

Try taking it to America and putting it a lift (we don't have elevators here). :D

Windows definitely has permissions, a more complicated and unwieldy version than linux. Although in truth they are generally less likely to be a concern.

Author:  David Gibson [ Sun 08 Jul 2018 14:33 ]
Post subject:  Re: PHP DIO module

Asking Google, (seehere) it seems that the error is because my files are not at C:\php, because XAMPP has put them somewhere else. Executing
Code:
pear config-set doc_dir C:\xampp\php\pear
pear config-set cfg_dir C:\xampp\php\pear
pear config-set data_dir C:\xampp\php\pear
pear config-set test_dir C:\xampp\php\pear
pear config-set www_dir C:\xampp\php\pear

But I now get a different error...
Code:
c:\xampp\php>pear install channel://pecl.php.net/dio-0.1.0
downloading dio-0.1.0.tgz ...
Starting to download dio-0.1.0.tgz (36,960 bytes)
..........done: 36,960 bytes
24 source files, building
WARNING: php_bin C:\xampp\php\php.exe appears to have a suffix .exe, but config variable php_suffix does not match
ERROR: The DSP dio.dsp does not exist.

Resorting to Google again, this fixed the warning...
Code:
pecl config-set php_bin C:\xampp\php
pecl config-set php_suffix \php.exe

but the ERROR is still present. Further investigation shows that this is a known PEAR bug on the Windows installer, which nobody is going to fix. :-( That's rather a nuisance.

Author:  David Cooke [ Sun 08 Jul 2018 14:54 ]
Post subject:  Re: PHP DIO module

Create a Linux virtual machine and do your development there?

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/