Skip to content

calcinai/php-ext-mmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-ext-mmap

This is a native mmap extension for PHP. It's been put together from a few bits and pieces and is designed to be a drop-in replacement for php-mmap to improve performance.

Installation

Installing custom php extensions is a pain, but if you have all the tools (php5-dev, gcc etc) installed, it's pretty easy

$ phpize
$ ./configure
$ sudo make install

Then it's just a matter of enabling the extension in your php.ini by adding the following line:

extension=mmap.so

Usage

Calling the mmap_open() function will return a stream resource that can be used with fread(), fwrite(), fseek(), fclose()

    //mmap_open($file_name, $block_size, $offset)
    $mmap = mmap_open('/dev/mem', 1024, 0);

About

Native PHP mmap extension

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published