Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting up php
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
d3c3it
l33t
l33t


Joined: 01 Mar 2003
Posts: 765
Location: Manchester, UK

PostPosted: Mon Jun 09, 2003 12:03 pm    Post subject: Setting up php Reply with quote

Hi
i want to start doing some php coding and i thought what would be a good idea was to have php running on my system. well i took a look at the gentoo desktop guide but the problem is i dont want the server to be for public consumtion ie for my system only. so what i wanted to know was what packages do i need to emerge/setup? also how would i go about using it? ie do i have to put my .php/mysql files in a persific folder or can i dump them anywhere?
thanks for any help :)
_________________
Some people go to counselling,
others use linux
Back to top
View user's profile Send private message
puggy
Bodhisattva
Bodhisattva


Joined: 28 Feb 2003
Posts: 1992
Location: Oxford, UK

PostPosted: Mon Jun 09, 2003 2:05 pm    Post subject: Reply with quote

I just did emerge php if I remember correctly. Then basically it sets itself up with apache. Then my apache htdocs folder under the httpd user in /home contains all my php files I want to use, but they can be anywhere in your htdocs really. Read up a bit on php and it will become apparent why nothing special really needs to be done to use php once you've got it set up.

Puggy

EDIT: Hmm, thinking about it, if this doesn't work there might be an ebuild to run or something. My mind is a bit cloudy on what I did as I was setting up phpbb and mysql and php and apache all in one evening. Apologies if its not this simple. I'll try and help you out further if you run into any problems.
_________________
Where there's open source , there's a way.
Back to top
View user's profile Send private message
dev-null-devil
Tux's lil' helper
Tux's lil' helper


Joined: 12 May 2003
Posts: 93

PostPosted: Mon Jun 09, 2003 2:16 pm    Post subject: Reply with quote

If im thinking what you are thinking you want to enable php for only one folder? You can do that with the <directory> setting in your apache.conf, just add module php inside and end it with </directory>.
_________________
All change, motion, and time is an illusion.
-- Plato, year 310
Back to top
View user's profile Send private message
d3c3it
l33t
l33t


Joined: 01 Mar 2003
Posts: 765
Location: Manchester, UK

PostPosted: Mon Jun 09, 2003 2:29 pm    Post subject: Reply with quote

puggy wrote:
I just did emerge php if I remember correctly. Then basically it sets itself up with apache. Then my apache htdocs folder under the httpd user in /home contains all my php files I want to use, but they can be anywhere in your htdocs really. Read up a bit on php and it will become apparent why nothing special really needs to be done to use php once you've got it set up.

Puggy

EDIT: Hmm, thinking about it, if this doesn't work there might be an ebuild to run or something. My mind is a bit cloudy on what I did as I was setting up phpbb and mysql and php and apache all in one evening. Apologies if its not this simple. I'll try and help you out further if you run into any problems.

cheers well thats my confusion ive read elsewhere about emergeing php_bb or something. all i want to do is be able to code php and access mysql then upload to where ever if my code is fine.
ill just try emerge php thats for the help:)
and dev-null-devil i just wondered where you put your php files after you emerged php so they would work properly:)but thanks for the handy tip:)
_________________
Some people go to counselling,
others use linux
Back to top
View user's profile Send private message
dev-null-devil
Tux's lil' helper
Tux's lil' helper


Joined: 12 May 2003
Posts: 93

PostPosted: Mon Jun 09, 2003 4:10 pm    Post subject: Reply with quote

Okey, lets see here, where you put them? it's the same directory as you put the rest of your *.htm/*.html files, but to make the server know that it's phpfiles, you have to have this if you want to have an index.php (arranged so if there isn't any index.html the index.php will be the default file and so on..):
Code:

<IfModule mod_dir.c>
DirectoryIndex index.html index.php index.php3 index.shtml index.cgi index.pl index.htm Default.$
</IfModule>


then you'll need this:
Code:

<IfDefine PHP4>
LoadModule php4_module    extramodules/libphp4.so
</IfDefine>

and this:
Code:

<IfDefine PHP4>
AddModule mod_php4.c
</IfDefine>

and zz.. this.. zz:
Code:
<IfModule mod_php4.c>
AddType  application/x-httpd-php         .php .php4 .php3 .phtml
AddType  application/x-httpd-php-source  .phps
</IfModule>


I think that's all, good luck! :)
_________________
All change, motion, and time is an illusion.
-- Plato, year 310
Back to top
View user's profile Send private message
d3c3it
l33t
l33t


Joined: 01 Mar 2003
Posts: 765
Location: Manchester, UK

PostPosted: Mon Jun 09, 2003 7:15 pm    Post subject: Reply with quote

thanks dev-null-devil least i know how to do that now:)
my main problem currently is emerging php, ie in what order do i emerge the system i emerge -p php and apache was never shown neither was mysql what actual procedure do i need to emerge this stuff or does it not matter the order in which i emerge it?
_________________
Some people go to counselling,
others use linux
Back to top
View user's profile Send private message
kopfarzt
Apprentice
Apprentice


Joined: 05 Apr 2003
Posts: 170
Location: Vienna, Austria

PostPosted: Mon Jun 09, 2003 7:39 pm    Post subject: Reply with quote

php can be emerged in two ways, as a programming language and/or as a module for apache. Try emerge -p mod_php to see apache come up.

If you want to use mysql, I would suggest to emerge mysql first. Php is very flexible, though does not require much, but will use it if it is there.

After the emerge, look at your /etc/conf.d/apache*

kopfarzt
Back to top
View user's profile Send private message
d3c3it
l33t
l33t


Joined: 01 Mar 2003
Posts: 765
Location: Manchester, UK

PostPosted: Mon Jun 09, 2003 8:10 pm    Post subject: Reply with quote

kopfarzt wrote:
php can be emerged in two ways, as a programming language and/or as a module for apache. Try emerge -p mod_php to see apache come up.

If you want to use mysql, I would suggest to emerge mysql first. Php is very flexible, though does not require much, but will use it if it is there.

After the emerge, look at your /etc/conf.d/apache*

kopfarzt

sorry to be irritating but what's the difference between the 2 phps? could i emerge just mysql and php and still be able to test my php files/php site or would i have to emerge the mod_php instead? or do you have to emerge the whole damn lot? and will i need additional flags in my make.conf.
sorry to be asking all this ive never setup a server of any kind always gone from the desktop aspect of computing anyway the reason i wanted to try my hand at php is i want to make myself my own blog type thing
_________________
Some people go to counselling,
others use linux
Back to top
View user's profile Send private message
kopfarzt
Apprentice
Apprentice


Joined: 05 Apr 2003
Posts: 170
Location: Vienna, Austria

PostPosted: Mon Jun 09, 2003 8:27 pm    Post subject: Reply with quote

php is optimized for use in webpages. There are lots of programming languages out there, which are very good, for example Python (not only my favourite :-)

So, while you can use PHP for daily programming jobs, it is best suited for webpages (IMHO). Emerge mysql, mod_php and you will be fine, as you want to do web pages. Only emerge php if you want to write stand-alone php programs with gtk user-interface or whatever, that you can directly start from the command line. (Hope that this won't start a religious flame war).

kopfarzt
Back to top
View user's profile Send private message
d3c3it
l33t
l33t


Joined: 01 Mar 2003
Posts: 765
Location: Manchester, UK

PostPosted: Mon Jun 09, 2003 10:08 pm    Post subject: Reply with quote

cheers man i know exactly what to do now :)
i never realised php could be used for programming i thought it was a webbased programming language, like asp *might be wrong?* anyway away i go to emerge, if it goes wrong you will be recieving private messages lol
_________________
Some people go to counselling,
others use linux
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum