Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

Issues with Direct IO #495

Open
jimbo8098 opened this issue May 13, 2015 · 3 comments
Open

Issues with Direct IO #495

jimbo8098 opened this issue May 13, 2015 · 3 comments

Comments

@jimbo8098
Copy link

In order to allow DirectIO to work on my installation , I had to add the following to the file_write function:

$tpath = "/var/www/infinity.whacknet.com/public_html/" . $path;
$path = $tpath;

This just appends my particular web root.

Looks like the fact that parent directories aren't added into the path wrecked dio support.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@ctrlcctrlv
Copy link
Owner

that's bizarre. i don't do anything like that on 8chan's install and it uses DIO...

@jimbo8098
Copy link
Author

It had me stumped for about a day as well! I've never used dio so there was a lot of trawling on the dio documentation and a lot of puzzled expressions from me where I realised a very basic test worked fine with fopen but not dio. Following raising the issue with stackoverflow:

http://stackoverflow.com/questions/30202817/fopen-works-dio-open-doesnt?noredirect=1#comment48511181_30202817

I found that I'd missed one vital question. Is it using the correct directory! fopen proved that it was able to find the parent directory but dio didn't do the same, presumably because it also uses fancy block devices and such.

Hence the hack!

Should be easy enough to add in a reference in config.php. I'll look into that once I grab some coffee ;)

@jimbo8098
Copy link
Author

One unexpected recompile of PHP later...

I've added $config['rootdir'] to my config.php file and that's not taken the place of the quick hack from before.

Additionally, a bit of a FYI while I remember, it looks like there is an issue in 5.6.6 since APC isn't supported. I tried APCu and that also failed to work with the installation. I finally resorted to using the php cache engine by setting this in secrets.php

$config['cache']['enabled'] = 'php';

That resolved the issue with APC ;)

I'm still seeing issues using rebuild.php which gives the following when output:

[root@death public_html]# php tools/rebuild.php
== Tinyboard + vichan  ==
Clearing template cache...
Regenerating theme files...
Generating Javascript file...
Error: file_get_contents(js/wPaint/8ch.js): failed to open stream: No such file or directory /var/www/infinity.whacknet.com/public_html/inc/functions.php:1987
#0  error() called at [/var/www/infinity.whacknet.com/public_html/inc/functions.php:384]
#1  verbose_error_handler()
#2  file_get_contents() called at [/var/www/infinity.whacknet.com/public_html/inc/functions.php:1987]
#3  buildJavascript() called at [/var/www/infinity.whacknet.com/public_html/tools/rebuild.php:51]

I'll let you know how I get on with that.

Additionally, I've not been clear exactly what's in use here so here goes:

[root@death public_html]# php -v
PHP 5.6.6 (cli) (built: May 13 2015 17:08:32)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
[root@death public_html]# php -m
[PHP Modules]
apc
apcu
Core
ctype
date
dio
dom
ereg
fileinfo
filter
ftp
gd
hash
iconv
json
libxml
mbstring
mcrypt
mysql
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zlib
[root@death public_html]# /usr/local/apache2/bin/httpd -M
Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 mpm_event_module (static)
 authn_file_module (shared)
 authn_core_module (shared)
 authz_host_module (shared)
 authz_groupfile_module (shared)
 authz_user_module (shared)
 authz_core_module (shared)
 access_compat_module (shared)
 auth_basic_module (shared)
 reqtimeout_module (shared)
 filter_module (shared)
 mime_module (shared)
 log_config_module (shared)
 env_module (shared)
 headers_module (shared)
 setenvif_module (shared)
 version_module (shared)
 unixd_module (shared)
 status_module (shared)
 autoindex_module (shared)
 suexec_module (shared)
 dir_module (shared)
 alias_module (shared)
 php5_module (shared)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants