The British Caving Association

Any views expressed are not necessarily those of the BCA
It is currently Fri 21 Sep 2018 07:46

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: PHP DIO module
PostPosted: Sat 07 Jul 2018 11:43 
Offline
User avatar

Joined: Thu 16 Mar 2006 23:45
Posts: 489
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


Top
 Profile  
 
 Post subject: Re: PHP DIO module
PostPosted: Sat 07 Jul 2018 13:22 
Offline
Site Admin

Joined: Thu 29 Dec 2005 23:22
Posts: 292
Location: Axbridge, Somerset, UK
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.

_________________
Dave Cooke
BCA Web Services, National Cave Registry Co-ordinator, CSCC Treasurer


Top
 Profile  
 
 Post subject: Re: PHP DIO module
PostPosted: Sun 08 Jul 2018 13:00 
Offline
User avatar

Joined: Thu 16 Mar 2006 23:45
Posts: 489
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.


Top
 Profile  
 
 Post subject: Re: PHP DIO module
PostPosted: Sun 08 Jul 2018 13:31 
Offline
Site Admin

Joined: Thu 29 Dec 2005 23:22
Posts: 292
Location: Axbridge, Somerset, UK
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.

_________________
Dave Cooke
BCA Web Services, National Cave Registry Co-ordinator, CSCC Treasurer


Top
 Profile  
 
 Post subject: Re: PHP DIO module
PostPosted: Sun 08 Jul 2018 14:33 
Offline
User avatar

Joined: Thu 16 Mar 2006 23:45
Posts: 489
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.


Top
 Profile  
 
 Post subject: Re: PHP DIO module
PostPosted: Sun 08 Jul 2018 14:54 
Offline
Site Admin

Joined: Thu 29 Dec 2005 23:22
Posts: 292
Location: Axbridge, Somerset, UK
Create a Linux virtual machine and do your development there?

_________________
Dave Cooke
BCA Web Services, National Cave Registry Co-ordinator, CSCC Treasurer


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group