02-procedure.sgml
来自「PHPLOB注释详细版 使用模板技术的好帮手 PHP最有用的东东了」· SGML 代码 · 共 117 行
SGML
117 行
<!-- $Id: 02-procedure.sgml,v 1.1.1.1 2000/04/17 16:39:59 kk Exp $ --><sect1>Installation procedure <p><tt/mod_php/ note: The following instructions applyto the CGI version of PHP as well as to the module version. Ifyou are working with <tt/mod_php/, you must restart yourweb server to force a reload of the <tt/php3.ini/ file, though.If you are using <tt/mod_php/, you have additionalconfiguration options: See the section below on using PHPLIBmit <tt/mod_php/.<descrip><tag>Library Setup</tag>Create a directory php next to your cgi:<tscreen><code>/home/www/servers/phplib.netuse.de/pages <- document root cgi <- php binary php <- includes and prepends</code></tscreen>Make this php directory your php include directory: Put <tt>include_path = /home/www/servers/phplib.netuse.de/php</tt>into <tt>cgi/php3.ini</tt>. If you already have an include pathdefined in your setup, add the PHPLIB include path to theexisting include path using the separator character applicablefor your operating system (":" on UNIX, ";" on Windows).Defining an include path will not actually include code on yourpages; it only tells the PHP interpreter in which directories tolook for files referenced in <tt/require()/ and <tt/include()/statements.Into the <tt/php/ directory go all the files from the <tt/php/directory of the distribution. Into documentroot, put all thefiles and directories from the <tt/pages/ directory of thedistribution.Have <tt/documentation.txt/ handy and read it.<tag>Database access with MySQL</tag>The following information applies to MySQL only. No informationis provided for other database servers as of now. You areencouraged to copy this section, adapt it for your databaseserver and submit it to the authors. It will be included infurther releases of PHPLIB.Edit <tt/prepend.php3/. Change the first <tt/require()/statement to <tt/require("db_mysql.inc");/. This willinclude the MySQL database interface (Interfaces for otherdatabases are provided in<tt/db_<databasename>.inc/. The <tt/require()/statement has to be adapted to reflect this).Assuming your database server is named <tt/database.netuse.de/and your CGI user is <tt/webuser/ and you are accessing thedatabase <tt/myapp/, do<tscreen><code>mysql -h database -u webuser myapp</code></tscreen>If it does not work, connect your database as administrator andcreate the proper mysql access permissions. Adapt and run<tt/create_database.mysql/ from the <tt/stuff/subdirectory of the distribution to create the databases<tt/active_sessions/ and <tt/auth_user/ as well asthe sample user <tt/kris/ with password <tt/test/. Try again toconnect like shown above. Can you do <tt/select * fromactive_sessions/? and <tt/insert intoactive_sessions values ("1", "2", "3", "")/ as well as<tt/delete from active_sessions/? Can you <tt/select *from auth_user/?<em/Note:/ Additional database creation scripts are provided forseveral different databases in the <tt/stuff/ directory of thedistribution.<tag>Merging the library with your PHP files</tag>Decide if you want to use <tt/include/ or<tt/auto_prepend_file/. We do use<tt/auto_prepend_file/here and we add the statement<tt>auto_prepend_file =/home/www/servers/phplib.netuse.de/php/prepend.php3</tt> to our<tt/php3.ini/.Not all classes are included/required by <tt/prepend.php3/, onlycore functionality files are: <tt/db_xxx.inc/,<tt/ct_sql.inc/, <tt/session.inc/,<tt/auth.inc/, <tt/perm.inc/, <tt/user.inc/, <tt/local.inc/ and<tt/page.inc/. The library provides other, less essentialclasses that can be included manually on a page-by-page basis.Some classes make themselves persistent, if used. These classesrequire that you include their definitions in the<tt/prepend.php3/ file where indicated to function correctly.See the usage instructions for these classes for details.Having done this, access <tt>/index.php3</tt>. The countershould increment when that page is being reloaded. Also, checking<tt/active_sessions/ in the database should reflect thatsession.<tag>Subscribe for support</tag>Subscribe to the mailing list <htmlurl url="mailto:phplib@lists.netuse.de"name="phplib@lists.netuse.de">. Do so by sending a mail body of <tt/subscribe/to <htmlurl url="mailto:phplib-request@lists.netuse.de"name="phplib-request@lists.netuse.de"> and follow instructions. Share yourexperiences.</descrip>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?