Install PGroonga. See install document for details.
Create PostgreSQL user php_document_search_user for this application:
% createuser --pwprompt php_document_search_userCreate PostgreSQL database php_document_search for this application. The database is owned by the created user:
% createdb --owner php_document_search_user php_document_searchInstall PGroonga to the created database. It needs superuser privilege. You can't use the created user:
% psql --command 'CREATE EXTENSION pgroonga;' php_document_searchCreate .env file based on .env.example:
% cp .env.example .envYou need to configure the following items in .env:
DB_PASSWORD: The password what you typed forcreateuser.
Setup database schema:
% php artisan migratePrepare PHP document to be searched. You have two options:
-
Download generated PHP document
-
Generate PHP document
You can download generated PHP document from
http://jp2.php.net/download-docs.php . You must choose "Many HTML
files" version. You must extract it as public/doc/. Here are command
lines to do this:
% wget http://jp2.php.net/distributions/manual/php_manual_ja.tar.gz
% tar xf php_manual_ja.tar.gz
% mv php-chunked-xhtml public/docYou can generate PHP document on your machine. Here are command lines to do this. See also: http://doc.php.net/phd/docs/ .
% sudo pear install doc.php.net/phd
% sudo pear install doc.php.net/phd_php
% sudo pear install doc.php.net/phd_pear
% svn co https://svn.php.net/repository/phpdoc/modules/doc-ja ../phpdoc
% cd ../phpdoc
phpdoc% php doc-base/configure.php --with-lang=ja
phpdoc% phd -d doc-base/.manual.xml -P PHP -f xhtml
phpdoc% cd -
% ln -s ../../phpdoc/output/php-chunked-xhtml public/docRegister PHP document:
% php artisan doc:registerRegister auto complete candidates:
% php artisan term:registerRun server:
% php artisan serveOpen http://localhost:8000/.