PDA

View Full Version : PHPwebsite install


ijasont
04-03-2003, 12:07 PM
I am wanting to install phpwebsite but I am a relative newcommer to the Terminal.
Can anyone offer a quick how to for installing the package?
Or direct me to a website that offers such a walk throught?

Thanks much,
Jason

griffman
04-03-2003, 12:49 PM
Do you already have PHP and MySQL installed and running?

-rob.

ijasont
04-03-2003, 01:06 PM
Sorry I should have mentioned this in my first post.
yes I have PHP and MYSQL working fine. I am also running PHPMyAdmin for db managment.

Thanks for your help
Jason

griffman
04-03-2003, 02:25 PM
I know I've installed it at home; I'll take a look at it tonight and try to write something back. I seem to recall it was really simple, but I'll double-check...

-rob.

ijasont
04-03-2003, 02:38 PM
Sounds great.
Thanks for the effort! I will check back tonight.
Jason

bluehz
04-03-2003, 03:27 PM
What exactly are you having trouble with?

Tell me where you are progress wise?

The install is really easy. Just let me know some details and I shoudl be able to walk you through it.

ijasont
04-03-2003, 03:35 PM
Well, like I said I am pretty new to this...I have the file downloaded and that is it :rolleyes:
Jason

bluehz
04-03-2003, 04:20 PM
Here's a quickie I typed up...

######################################################################
Instructions Installing phpWebSite 0.8x versions - Mac OS X
######################################################################

First a few pre-requisites:

* You must have PHP, MySQL, and Apache installed and running.
* Decide how you want the url displayed for your phpwebsite.
- Homedir install - you can put it in your home dir and your url will look like:
http://yourdomain/~yourusername/phpwebsite
- Systemwide Install - You can install it systemwide in which case your url will look like:
http://yourdomain/phpwebsite
- DefaultSite install - Or you can install it as your default website which would show up when you used a url like:
http://yourdomain
* You will need to setup and have access to a MySQL database named of your choosing (ex. phpwwebsite)

######################################################################
STEP 1 - CREATE THE DATABASE
######################################################################

1. You will need to create a new database for phpws to use. There are several methods of creating and managing MySQL databases - and it is beyond teh scope of this doc to explain MySQL management. I would recommend getting phpMyAdmin, install it and then create your database:

http://www.phpwizard.net/projects/phpMyAdmin/
or (better) from SourceForge
https://sourceforge.net/projects/phpmyadmin/

For our example we will name our database "phpwebsite"

######################################################################
STEP 2 - DOWNLOAD, DECOMPRESS, INSTALL FILES
######################################################################

Now depending on what type of install you want (see section above) - Home install, Systemwide Install, DefaultSite Install - you need to download the phpwebsite package and decompress it.

Let's assume we are doing a SystemWide install.

Launch the terminal and follow along below (everywhere you see the % on a line below - that is a command you enter into the terminal and then return - do not type the % symbol itself):

% cd /Library/WebServer/Documents
% curl http://unc.dl.sourceforge.net/sourceforge/phpwebsite/phpwebsite-0.9.0.tar.gz
% tar -zxvf phpwebsite-0.9.0.tar.gz
% ln -s phpwebsite-0.9.0 phpwebsite
% cd phpwebsite

Change some permissions

% chown -R www:www images/
% chown -R www:www mod/mainpage/images/
% chown -R www:www mod/userpage/images/
% chown -R www:www mod/userpage/uploads/

Ok - you should now have the pkg downloaded, decompressed and changed dir into the phpws dir and are now ready to edit the config file.

% pico config.php

You should now have a text file open in the pico text editor. You will need to edit teh following variables in this file. The actual value will depend on your own setup (make sure to change evrything below with the @FORMAT@ style):

###################
# DATABASE CONFIG #
###################

$dbhost = "localhost"; <<< use localhost
$dbuname = "phpwsuser"; <<< the user that has access to your db
$dbpass = "phpws"; <<< the password for the user above to access db
$dbname = "phpwebsite"; <<< database name - from creation above

$table_prefix="phpws"; <<< this is prefix used in database - I recommend phpws


#########################
# Cookies Configuration #
#########################

$cookieusrtime = "2592000"; // cookie expiration time -- 2592000 = 1 month
$cookiePrefix = "@SITENAME@"; # Change this to be unique for your site.

##############################
# Site Identification Config #
##############################

$phpws_url = "http://yourdomain/phpwebsite"; # SystemWide site url


$sitename = "@SITENAME@"; # Your Site Name
$titletag = "@EXTRA@"; # This is appended to your site name in the browser titlebar.
$titlebar = "phpWebSite"; # This will appear in the header on each page.
$startdate = "@DATE@"; # When did your site launch?
$adminmail = "@ADMIN_EMAIL@"; # Admin email.

After you finish editing the config.php file to meet your needs, save it from pico with the ctrl+x command - this will exit and save the file.

Thats the worst of it! The rest is EASY!

######################################################################
STEP 4 - COMPLETE INSTALLATION
######################################################################

phpWebSite has a completely web-based install - point your browser to:

http://yourdomain/phpwebsite

and follow the onscreen instructions.

######################################################################
STEP 5 - LOGIN TO YOUR NEW SITE
######################################################################

Your new phpwebsite is now at:

http://yourdomain/phpwebsite

You can administer your site by going to:

http://yourdomain/admin.php

and logging in using the following:

Username: admin
Password: phpwebsite

Remember to change the admin password (Edit Admins) in order to protect your site!

######################################################################
STEP 6 - CLEANUP INSTALLATION
######################################################################

Delete or move the setup folder when you have confirmed your successful installation.

griffman
04-03-2003, 04:58 PM
Whew, that's one homework assignment off my plate ;-).

Thanks!

-rob.

bluehz
04-03-2003, 05:08 PM
Hahaha - I really just modified the docs for Mac and newbie terminal user info.... so I can't take all the credit for it. I just remember when I asked questions no less than a year ago and some one took the time to help me... just wanna give back what I been takin :)

ijasont
04-03-2003, 05:11 PM
WOW that is amazing. Thanks a ton for doing that!

A few questions.
ln -s phpwebsite-0.9.0 phpwebsite
This gives me a "In command not found"
I just went in and changed the name to phpwebsite manually

Chown -R www:www images/

chown: images//manager/down_pointer.png: Operation not permitted
chown: images//manager/sort_none.png: Operation not permitted
chown: images//manager/up_pointer.png: Operation not permitted
chown: images//manager: Operation not permitted
chown: images//menuman/down.gif: Operation not permitted
chown: images//menuman/up.gif: Operation not permitted
chown: images//menuman: Operation not permitted
chown: images//textpad/delete.gif: Operation not permitted
chown: images//textpad/edit.gif: Operation not permitted
chown: images//textpad/view.gif: Operation not permitted
chown: images//textpad: Operation not permitted
chown: images/: Operation not permitted

The other Chown commands could not find the file i.e.
mod/mainpage/images/ does not exist

config.php:
I created this file in bbedit and made the correct changes. I saved this file in /documents/phpwebsite/
I then went to localhost/phpwebsite and it said I did not have a config.php file so I entered the information and upon 'send' it said it "Could not connect to the database"

Thanks again for your help.
Jason

bluehz
04-03-2003, 06:04 PM
That is actually a lowercase L in the ln. But what you did is fine too. The ln creates a symlink (similar to an alias) that points to the actual install. I normally do a symlink like that so if I need to upgrade the pkg - lets say the package name changes to "phpwebsite-0.9.1" I can simply delete that one symlink, and recreate it pointing to the new install. That way nothing breaks.
A few questions.
ln -s phpwebsite-0.9.0 phpwebsite
This gives me a "In command not found"
I just went in and changed the name to phpwebsite manually

I was thinking that might happen. I suspect you need to be root to make those changes. Try this in the terminal.

% su

then enter your admin password, it should be accepted and you will now be the root user. Now cd back to the phpwebsite dir:

% cd /Library/WebServer/Documents/phpwebsite

and run the chown commands again and see if that works.


Chown -R www:www images/

chown: images//manager/down_pointer.png: Operation not permitted
chown: images//manager/sort_none.png: Operation not permitted
chown: images//manager/up_pointer.png: Operation not permitted
chown: images//manager: Operation not permitted
chown: images//menuman/down.gif: Operation not permitted
chown: images//menuman/up.gif: Operation not permitted
chown: images//menuman: Operation not permitted
chown: images//textpad/delete.gif: Operation not permitted
chown: images//textpad/edit.gif: Operation not permitted
chown: images//textpad/view.gif: Operation not permitted
chown: images//textpad: Operation not permitted
chown: images/: Operation not permitted

I am not sure about this one - you might just try creating the images dir in the location specified and see what happens. I will look into my install and see.

The other Chown commands could not find the file i.e.
mod/mainpage/images/ does not exist


Maybe I didn't explain this well - sorry. Actually the config.php file comes in the package - it should be in your phpwebsite dir. You can edit it with BBEdit (thats what I use as a matter of fact). The info I posted was basically clipped from that config.php file that already exists. I was only showing the pertinent sections you needed to modify. If for some reason you overwrote the config.php file in the phpwebsite dir when you created it with BBEdit - you can always just decompress the archive again (in another safe location) and grab the original config.php file from there and move it in to your phpwebsite dir. I usually immediately make a backup of config type files when I first start an installation - that way I always have a copy to fall back on and for reference.

config.php:
I created this file in bbedit and made the correct changes. I saved this file in /documents/phpwebsite/
I then went to localhost/phpwebsite and it said I did not have a config.php file so I entered the information and upon 'send' it said it "Could not connect to the database"

ijasont
04-03-2003, 06:31 PM
You know. I have been having problems with "su" for some reason.

I type it in and get the password prompt and i enter my pass and I get
Su Sorry
I never used to have this problem. Is there a way to check this?

Again, thanks for the help!
jason

EDIT: I did not have config.php or any of the other directories I mentioned in my post. I dloaded the tar then uncompressed using Stuffit and placed the unzipped file in /Documents/
I tried doing the curl but my terminal just started reading page after page of strange symbols. It did not dload anything.

bluehz
04-03-2003, 06:53 PM
You might open up /Utilities/Netinfo and check that the root user is enabled. Other than that - just make sure you are typing the password EXACTLY.

Ooops - sorry - another typo on my part (well I did it in 5 mins.. c'mon...hahaha). The curl should actually read:

% curl -O curl http://unc.dl.sourceforge.net/sourceforge/phpwebsite/phpwebsite-0.9.0.tar.gz

but I just tried that and it was not downloading. So I did this:

wget curl http://unc.dl.sourceforge.net/sourceforge/phpwebsite/phpwebsite-0.9.0.tar.gz

and it downloaded fine.

One note though - I just realized this is a new 0.9 release that I have not updated too. I was writing from experience with 0.8 v. Let me install it later tonight and I will get back to you with 0.9 specific instructions.

You might also look at docs dir in the phpwebsite dir if you don't want to wait.

I will get back to you in a few hours.

bluehz
04-03-2003, 09:02 PM
Ok sorry for the confusion - I was unware they had updated - even though it was right in front of my face in the download url. Forget all I said above - that is for v8x version of phpwebsite.

The installation for PhpWebsite 0.9.0 is actually even easier....


######################################################################
# INSTALLATION FOR PHPWEBSITE 0.9.0 - MAC OS X
#
# STEP 1 - Download
######################################################################

cd /Library/WebServer/Documents

# retrieve the src files
wget http://unc.dl.sourceforge.net/sourceforge/phpwebsite/phpwebsite-0.9.0.tar.gz

# decompress the src files
tar -zxvf phpwebsite-0.9.0.tar.gz

# create a symlink from the actual src files
# to an easier to use "phpwebsite"
# you could just rename the dir if desired
ln -s phpwebsite-0.9.0 phpwebsite

# change into the phpwebsite directory
cd phpwebsite

######################################################################
# STEP 2 - INSTALL
######################################################################

# make sure you have previously created a database in MySQL


cd setup

# modify the setup script for Mac Apache user:group
pico secure_phpws.sh

# change these lines at the top of the script
# and save the file
#
# APACHE_USER=apache
# APACHE_GROUP=apache
#
# to
# APACHE_USER=www
# APACHE_GROUP=www

# now run the permissions setup script
# you should get a line that reads
# "Permissions set!" if it is successful

./secure_phpws.sh setup

######################################################################
# STEP 2 - INSTALL
######################################################################

# Use your browser to navigate to
# http://yourdomain/phpwebsite/setup/
#
# Form is pretty straightforward
#
# Database version = mysql
# Database host = localhost
# Database user = xxx
# Database password = xxx
# Database name = phpwebsite
# Table prefix = phpws
# Web Address = yourdomain/phpwebsite/
# File Address = /Library/Webserver/Documents/phpwebsite/
# Hub Hash = unique number (do not touch)
# Install Password = xxx
#
# click the "Save Config File"
#
# if all goes well you should get a screen that says
# "Configuration file saved under the name conf/config.php"
#
# Select the 'here' link to continue to the actual installation.
#
# Next page - enter your password from above
# Next page - create admin acct
# Next page - select modules you want - I chose all, you can always
# change later
# Next page - bottom of page "Go to my installation"

######################################################################
STEP 3 - SECURE THE INSTALLATION
######################################################################

cd ./setup/
./secure_phpws.sh setup run root.admin

# Thats it! You're done - login with the username and password you
# created above. Then access "Modules" in the left-hand menu....

ijasont
04-03-2003, 10:34 PM
THAT WORKED!!

had a bit of trouble with the user name. Had to use 'root' + pass and not my Admin user name :( . But it said install went fine. but I am running apache 4.1.2 not 4.2.2 so I have to update my php.
That should not be any big deal.

BTW. Did you get a notice sayign you are not running a Unix server? I figure i will just ignore this?

Again, thanks A TON!!
Your help was very much appreciated.

Jason

bluehz
04-03-2003, 10:55 PM
I did not get a notice about running a unix server.

Glad it worked out for you.

Are you using Fink to install pkgs? I think you can install both an updated Apache and an updated PHP via Fink. I would stay away from the Apache 2.x versions though - I tried using those and it was nothing but trouble with everything. I guess all src needs to be updated to run in 2.x versions so nothing was working right. Just my experience. If you are not using Fink I would highly recommend it - makes compiling and installing stuff painless.

ijasont
04-03-2003, 11:01 PM
Well I just tried updating to 4.2.2 direct from http://www.entropy.ch/software/macosx/php/

I follow the install instructions exactly and now, after restarting my comp Apache will not even start up!
grrrr.
I looked in my http.conf file and everything is configed right. Who knows.
I will find and dload fink and try that.

bluehz
04-03-2003, 11:20 PM
Yeah Apache and PHP have caused me more headaches than I care to think about. Add in OS X oddities and you have a recipe for madness.

What version of OS X are you running?

Up until about the first of this year I relied on the entropy stuff also. GREAT STUFF! And a lifesave before their was Fink. Alas - I have given way to convenience with Fink. Sure makes for a lot less hairpulling, but with something like Apache and PHP you have to accept what the Fink pkg developer has decided needs to be compiled into thos pkgs. The option in a manual install of Apache and PHP are many - and you can customize and modularize and go wild with it when you manually compile and install. BUT - it can take you a whole day working the kinks out. The entropy and Fink stuff assume the standards and just compile in a generic set which is probably good enough for 99% of users.

What I found with the Entropy stuff is that many times a problem can arise from a simple ordering of text in the httpd.conf file - for instance at one time their was a maddening bug where no one was able to startup Apache. Turns out it was a simple switch of the php module loading order. Easy stuff - hard to troubleshoot.

I would take a good look at the entropy pages and read thoroughly - he is really good about providing info, troubleshooting, etc. His pkgs are really good so I suspect there is a simple solution.

Are you getting any particular error msg when starting up Apache?

I assume you are starting from the PrefPane - is that correct?

Try this - open a terminal window, su to root and enter:

% httpd -t

this will run a syntax check on your httpd.conf file and may point out any errors.

You can also try

% httpd -h

to get a listing of other things you can look at. Can't really harm anything here so peck away.

---

I just perused entropy and found the problem I was thinking of that is simple but cause Apache to not start...

You need to change the order of the LoadModule and AddModule directives in the Apache configuration file /etc/httpd/httpd.conf so that the WebDAV module is loaded and added after the PHP module. Big thanks to Chris Janton for this tip.

... make sure to change the order in BOTH section of module loading.

ijasont
04-03-2003, 11:37 PM
I have fink installed, wish I did this rather than Entropy. Oh well. I will go through his site and see what is what.
I ran the httpd -h and also -t I got this

Processing config directory: /private/etc/httpd/users
Processing config file: /private/etc/httpd/users/jasontugman.conf
Syntax OK
dyld: httpd Undefined symbols:
_XML_ErrorString
_XML_GetErrorCode
_XML_Parse
_XML_ParserCreate
_XML_ParserFree
_XML_SetCharacterDataHandler
_XML_SetElementHandler
_XML_SetUserData
Trace/BPT trap

So i guess I need to look thought his site.

BTW I am running 10.2.4 I restarted apache from the sharing folder. When i do so it just sits in 'starting' and never does.

bluehz
04-03-2003, 11:48 PM
Look at this page...
http://www.oreillynet.com/cs/user/view/cs_msg/10014?page=last&x-showcontent=text

Shows exact same error and indicates that it is indeed the WebDAV module loading order.

ijasont
04-04-2003, 12:01 AM
NICE FIND!
That was it.
Thanks to you I now have phpwebsite, fink and a current version of apache/php running!

/bows deeply
Jason

ijasont
04-04-2003, 12:20 AM
OK maybe you are not getting off THAT easy :D

I cannot locate the admin page.
localhost/admin.php does not exists nor does /phpwebsite/admin.php

Shouldn't this file have been created? the phpwebsite is little good for help.

EDIT:
Found it. guess I had to log in and then it will show it to me.
Seems a little weird but hey, its working!

bluehz
04-04-2003, 12:25 AM
Excellent!

Yes - you need to login with the user/pass you setup during the install. Then you will get a few new menu selection in teh left hand column. The main one is "Modules" that seems to lead to all teh config stuff. I must admit its completely different than my .8 install so I am not that familiar with the actual admin yet.