From: Dave P. <dav...@sh...> - 2002-11-21 22:13:53
|
Hello All. I have written a new and more complete set of installation instructions for use with phpMyEdit 5.1, which I'm including below. They are intended to replace section 2 of the Readme file. Let me know if you have any comments/corrections/additions. Note that these will need to be revised for new phpMyEdit versions. For example, the CVS version has already fixed the problem with the "require_once" outlined in step 2.2.9. In a subsequent email I'll outline some suggestions I have that should make the install a bit easier. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D phpMyEdit 5.1 ------------- 2. Installation Two types of installation are documented - Basic and Custom. If you are using phpMyEdit for the first time, it is suggested to do a Basic installation. Once you have confirmed that phpMyEd= it is working properly in your environment, you may then wish to do a Custom installation. If you do a Custom installation and ha= ve problems getting phpMyEdit to work properly, please do a Basic installation first to confirm whether the problem is being cause= d by something you have done in your Custom installation. Please read both the Basic and Custom installation documentation before asking "why doesn't phpMyEdit work on my system". 2.1 Basic Installation Definitions: - local system: location where you have downloaded the phpMyEdit distibu= tion=20 archive - server: webserver where you wish to install phpMyEdit 2.1.1 Download the phpMyEdit distribution archive to your l= ocal=20 system. 2.1.2 Extract the phpMyEdit distribution archive on your lo= cal=20 system. 2.1.3 Copy all the phpMyEdit files/directories to your serv= er, maintaining the directory structure. 2.1.4 Using a browser, run phpMyEditSetup.php, and enter: - the name(Hostname) of your MySQL server - the MySQL account name(Username) to be used to logi= n to the MySQl server - the password for the MySQL account Note that the values supplied for these fields are th= e default values used by the generated table editing program, s= o the default is that the generated program will be using a= n account that has the MySQL user rights associated with this a= ccount. 2.1.5 All available databases will be listed. Select the on= e you want by clicking the radio button next to its name, t= hen clicking on the "Submit" button at the bottom of the = page. 2.1.6 All tables in the selected databases will be listed. = Select the one you want by clicking the radio button next to= its name, then clicking on the "Submit" button at the bottom of= the page. 2.1.7 Follow the instructions on the page to select an 'ide= ntifier' field from the table(used for Changes and Deletes). 2.1.8 Fill in a 'Page Title', which will be used by the gen= erated table editing program. 2.1.9 Fill in a name(Base Filename) to be used for the gene= rated program's name. Avoid using characters that may cause= problems in your server's filesystem, such as spaces and punct= uation. 2.1.10 After you click on "Submit", the phpMyEditSetup.php s= cript will display a 'results page': - the top part of the page shows the name of the file= that was used, and whether or not phpMyEditSetup.php was= able to write the generated table editing program to tha= t file - the contents of the generated program are listed, w= hether or not the file creation succeeded - if the file creation failed, copy the generated pro= gram listing into your PHP editor, save it to a file, an= d then copy it to your server, into the same directory as = the phpMyEdit.class.php file 2.1.11 Using a browser, run the generated table editing PHP = script and confirm it is working properly in your server env= ironment. 2.2 Custom Installation Definitions: - local system: location where you have downloaded the phpMyEdit distibu= tion=20 archive - server: webserver where you wish to install phpMyEdit - setupdir: directory on the server which will contain phpMyEditSetu= p.php - includedir: directory on the server which will be used by PHP to inc= lude phpMyEdit files when scripts use "require" or "include" - scriptdir: directory on the server which will contain the scripts g= enerated by phpMyEditSetup.php Some of the steps listed in this section refer to modificati= ons to the PHP code in some phpMyEdit files. There are additional= =20 modifications that are possible in these files, and in the generated PHP s= cripts, but these are not required for the installation described be= low. 2.2.1 Download the phpMyEdit distribution archive to your l= ocal=20 system. 2.2.2 Extract the phpMyEdit distribution archive on your lo= cal=20 system. 2.2.3 When using phpMyEditSetup.php, to avoid sending the M= ySQL account name and password over the internet, find the= following lines in phpMyEditSetup.php: $submit =3D $HTTP_POST_VARS['submit']; $hn =3D $HTTP_POST_VARS['hn']; $un =3D $HTTP_POST_VARS['un']; $pw =3D $HTTP_POST_VARS['pw']; and change them to specify the vales for your MySQL h= ost, MySQL account name, and account password, and to simu= late having clicked on the "Submit" button. For example: $submit =3D 'submit'; $hn =3D 'mysql.mycompany.com'; $un =3D 'username'; $pw =3D 'password'; This will cause the script to start at the database s= election page, and prevent sending the username/password over = the net. 2.2.4 If you are only going to be using phpMyEdit with the = tables in one database, then in phpMyEditSetup.php you can s= pecify the database: $db =3D 'mydatabase'; Coupled with 2.2.3, this will cause the script to sta= rt at the table selection page. 2.2.5 To have phpMyEditSetup.php generate scripts in 'scrip= tdir' rather than in 'setupdir', change the following line: $inclDir =3D '.'; to something like: $inclDir =3D '../scriptdir'; Do not include a trailing slash(/). Your webserver process will need write permission to = this directory for phpMyEditSetup.php to be able to save t= he generated table editing program to a file. 2.2.6 Unless you are going to make your own modifications t= o phpMyEditSetup.php, don't bother changing the followi= ng lines, as they are not used in version 5.1: $phpExtension =3D '.phtml'; $phpExtension =3D '.php'; $destDir =3D '.'; $headerFile =3D 'SiteHeader.inc'; $footerFile =3D 'SiteFooter.inc'; 2.2.7 It is suggested that you make use of an "include file= " to contain the MySQL hostname, account, and password tha= t will be used by the scripts generated by phpMyEditSetup.ph= p. Aside from issues of site maintainability and security, thi= s is also a good idea because by default phpMyEditSetup.php dis= plays the generated script contents on a webpage, which means t= hat=20 without this change, the username/password will be sent over = the net when you run phpMyEditSetup.php. In phpMyEditSetup.php find the following lines: /* NOTE: coder is strongly urged to remove the hn, un, pw lines from here and set values in PME_site_defaults.inc require "PME_site_defaults.inc"; */ ' $opts["hn"] =3D "'.$hn.'"; $opts["un"] =3D "'.$un.'"; $opts["pw"] =3D "'.$pw.'"; Change these to read: /* NOTE: coder is strongly urged to remove the hn, un, pw lines from here and set values in PME_site_defaults.inc $opts["hn"] =3D "'.$hn.'"; $opts["un"] =3D "'.$un.'"; $opts["pw"] =3D "'.$pw.'"; */ ' require "PME_site_defaults.inc"; Do not remove the single quote on the line by itself. 2.2.8 If you are going to do step 2.2.7, you will need to c= reate a "PME_site_defaults.inc" file, with the following co= ntent: $opts['hn'] =3D "mysql.mycompany.com"; $opts['un'] =3D "username"; $opts['pw'] =3D "password"; 2.2.9 The 5.1 version of the phpMyEdit.class.php file requi= res there to be a "timer.class" file in the same directory. The= use=20 of the 'timer' is controlled by the setting of=20 $opts['display']['time'] in the generated scripts, and defaults to false. If y= ou do not want to use the timer(it displays the time for ea= ch operation at the bottom of the page, like "78.024= =20 milliseconds"), and you do not wish to have the "timer.class" file on= your server, edit phpMyEdit.class.php and find the followi= ng line: if (@require_once dirname(__FILE__).'/timer.clas= s') { and change it to: if (@include_once dirname(__FILE__).'/timer.clas= s') { If you do not do this, and you do not have a "timer.c= lass" file, then your generated scripts will fail to produc= e any output, without generating any error messages. 2.2.10 If it doesn't already exisit on the server, create 's= etupdir'. The minimum permissions needed for the directory are = those to enable you to use your browser to run phpMyEditSetup.= php. If you have not made the change outlined in 2.2.5, th= en your webserver process will need write permission to this = directory for phpMyEditSetup.php to be able to save the generat= ed program to a file. 2.2.11 If it doesn't already exisit on the server, create= =20 'includedir'. The minimum permissions needed for the directory are = those to enable the webserver process running the generated sc= ripts to be able to include files such as phpMyEdit.class.php = and PME_site_defaults.inc. 2.2.12 If it doesn't already exisit on the server, create 's= criptdir'. The minimum permissions needed for the directory are = those to enable the webserver process to run the generated scr= ipts. If you have made the change outlined in 2.2.5, then y= our webserver process will need write permission to this = directory for phpMyEditSetup.php to be able to save the generat= ed program to a file. 2.2.13 Copy the following files from the local system to the= server's 'setupdir': phpMyEditSetup.php 2.2.14 Copy the following files from the local system to the= server's 'includedir': phpMyEdit.class.php timer.class (see 2.2.9) PME_site_defaults.inc (see 2.2.7 and 2.2.8) 2.2.15 In 'includedir' create a subdirectory called 'lang'. Copy the following file from the local system to the = server's 'includedir/lang' directory: PME.lang.EN-US.inc You may wish to also copy the other supplied language= files. If the phpMyEdit.class.php file cannot include any la= nguage file(the default is PME.lang.EN-US.inc), then the gen= erated table editing scripts will not work(you will get a we= bpage with a table having two columns, "Field" and "Value",= and no data from the table). 2.2.16 If you are going to use the "graphic links" navigatio= n style in your table editing scripts(controlled by=20 $opts['navigation']), then in 'scriptdir' create a subdirectory called 'ima= ges', and copy the following files from the local system to the= server's 'scriptdir/images' directory: pme-change.png pme-copy.png pme-delete.png pme-view.png If using FTP to do the copying, make sure to use 'bin= ary' mode. 2.2.17 Using a browser, run phpMyEditSetup.php. If you imple= mented step 2.2.4, go to step 2.2.18. If you did not do step 2.2.4 it will start at the pag= e listing the available databases. Select the one you want by= =20 clicking the radio button next to its name, then clicking on the "= Submit" button at the bottom of the page. 2.2.18 All tables in the selected databases will be listed. = Select the one you want by clicking the radio button next to= its name, then clicking on the "Submit" button at the bottom of= the page. 2.2.19 Follow the instructions on the page to select an 'ide= ntifier' field from the table(used for Changes and Deletes). 2.2.20 Fill in a 'Page Title', which will be used by the gen= erated table editing program. 2.2.21 Fill in a name(Base Filename) to be used for the gene= rated program's name. Avoid using characters that may cause= problems in your server's filesystem, such as spaces and punct= uation. 2.2.22 After you click on "Submit", the phpMyEditSetup.php s= cript will display a 'results page': - the top part of the page shows the name of the file= that was used, and whether or not phpMyEditSetup.php was= able to write the generated table editing program to tha= t file, which would be in 'scriptdir' - the contents of the generated program are listed, w= hether or not the file creation succeeded - if the file creation failed, copy the generated pro= gram listing into your PHP editor, save it to a file, an= d then copy it to your server, into the 'scriptdir' direct= ory 2.2.23 Using a browser, run the generated table editing PHP = script and confirm it is working properly in your server env= ironment. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ----------- Dave Patton Canadian Coordinator the Degree Confluence Project http://www.confluence.org dp...@co... 49=B016'07"N 123=B009'07"W |