Setting it up
Пример Steps for Getting the Examples Going
Getting the LiveUser examples working can be somewhat difficult for
developers who are new to PHP and PEAR.
Here is a list of steps necessary to get the example4
and GVN examples working with a MySQL database in LiveUser
0.16.12
.
- Install PHP and MySQL OR Sign up with a web host that provides PHP and MySQL.
-
Install PEAR. This is done either with the
command line installer,
or by uploading
go-pear.php
to your web host through FTP. -
Now install the PEAR packages
LiveUser
,MDB2
,MDB2_Driver_mysql
,HTML_Template_IT
,HTML_QuickForm
, andVar_Dump
. Command line will be something like pear install --alldeps LiveUser-beta (repeat for each package). If you used thego-pear.php
, there's some web-based way to install packages through that, but I haven't used it. - Now create your empty database in MySQL.
-
Now copy the files of
example4
to your web root. On my Linux system the examples ended up in/usr/share/pear/docs/LiveUser/docs/examples
and my Apache web root is at/var/www
. You can find out where the examples are by executing pear list-files LiveUser. -
Create the database by viewing the
demodata.php
through your web browser with a URL likehttp://www.example.com/LU/demodata.php?dsn=mysql://dbuser:pwd@localhost/databasename&file=/var/www/LU/demodata.xml&create=1
. You must replace the file path values and the databaseuser
,password
,host
, anddatabase name
with values appropriate for your own system. If this gives you a "success" message and you have phpMyAdmin or something, you should be able to look at the database now and see tables with data in them.It is reported that on some systems, you must make alterations to the
demodata.xml
file before this will run properly. Within all <is_active>..</is_active> tags replace the value "Y
" with "1
" and "N
" with "0
". -
Edit the
conf.php
file and enter your database information. -
At this point you should be able to view the
index.html
page through a web browser and log in and useexample4
. - To get the GVN samples going, first create a "GVN" folder under your web root.
- Go through the GVN tutorials, starting from the beginning because there are dependencies, and save all of the sample files.
-
In most of the files I found that the include to
LiveUser/LiveUser.php
had to be corrected to just beLiveUser.php
. -
Copy the file
Auth_XML.xml
fromexample4
into the GVN folder. -
Copy your database information and the LiveUser configuration array from
example4/conf.php
into GVN'sconf.php
andconf_admin.php
files. -
In example4, the users that are in the database are deactivated for some reason...
in the
peoples
table change the values in theisactive
column to1
.
The above steps got me to the point where I have the working sample app and pages that demonstrate adding users, etc.