PHP Installation & Configuration

Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. third party software).

PHP Installation & Configuration

Postby rtwingfield » 19 Aug 2010, 00:46

I've just installed PHP v5.2.0 from the Ports, made the system, etc. The Make did not create a php.ini file. I've Googled and found a comment from someone (can't remember where) that PHP v5+ does not make a php.ini file ??? Is this true? If so, then I don't understand where to begin to configure PHP per applications that requires PHP (FYI, a calendar and forum.)

BTW, this is my first dance with PHP.
User avatar
rtwingfield
Member
 
Posts: 109
Joined: 19 Aug 2010, 00:19
Location: Little Rock, AR USA

Postby cuq » 19 Aug 2010, 03:26

hi rtwingfield,
mines are in [FILE]/usr/local/etc [/FILE]
but from man php it seems that you can tell where: [FILE] --php-ini path|file[/FILE] or [FILE]-c path|file [/FILE]
i have php 5.3.
hope this help
cheers
cuq
cuq
Junior Member
 
Posts: 30
Joined: 22 Feb 2010, 04:11

Postby gilinko » 19 Aug 2010, 04:30

It does copy the two example files [FILE]php.ini-development[/FILE] and [FILE]php.ini-production[/FILE] to your /usr/local/etc, and from these you can either copy them directly as your php.ini file(remove the -dev|-prod part) or create your own. If you are just starting out with PHP I would suggest that you just copy the development file and leave it as is.

Note that these are global configuration for PHP and any per application settings has to be set in you apache server, but that is not something that you would do until you are very familiar with it.
User avatar
gilinko
Member
 
Posts: 416
Joined: 18 Nov 2008, 06:02
Location: SV_se

Postby rtwingfield » 20 Aug 2010, 05:04

Thanks for the suggestion. Actually . . .FYI, the two distribution files are [font="Courier New"]php.ini-dist[/font] and [font="Courier New"]php.ini-recommended[/font]. I copied the [font="Courier New"]php.ini-recommended[/font] to [font="Courier New"]php.ini[/font], stripped it down and made some changes as indicated for the SMF(forum) system that I'm attempting to install. I'm still having some PHP/MySQL configuration problem, though, with the [font="Courier New"]./SMF/install.php[/font] failing. I'm pursuing that problem via the SMF forum.http://www.simplemachines.org/community/index.php?topic=396672.0
User avatar
rtwingfield
Member
 
Posts: 109
Joined: 19 Aug 2010, 00:19
Location: Little Rock, AR USA

Postby amitabh » 26 Aug 2010, 07:59

From the SMF Forums, it seems that PHP is not configured with Mysql correctly. The TestDB page should only contain "[FILE]phpinfo();[/FILE]" and nothing else to start with. If you open the testDB.php page on your browser, you should see a section on Mysql if you have configured PHP with Mysql correctly.

You can use [CMD=" "]php -i|grep mysql[/CMD] to check if you have mysql correctly configured. Also it would make sense to check if you ahve the mysql extension for PHP installed ([FILE]pkg_info | grep php5-mysql[/FILE])
amitabh
Junior Member
 
Posts: 24
Joined: 30 Nov 2008, 18:15

Postby rtwingfield » 27 Aug 2010, 14:20

In fact I have found (and should have posted sooner) that the php-extensions were not complete because the make had failed to complete successfully with regard to php sessions, [font="Courier New"]session_start()[/font], et al? I have installed [font="Courier New"]WebCalendar[/font] on a FreeBSD v7.2 box and all seems well. As soon as the mail server is working on the v7.2 box, I am going to upgrade the v4.8 box.

BTW, you can include [font="Courier New"]phpinfo()[/font] anywhere for test purposes . . .it will insert itself after and before anything that follows. The [font="Courier New"]testdb.php[/font] thing is just a proof-of-concept thing that I cobbled up :)

Thanks,
RW
User avatar
rtwingfield
Member
 
Posts: 109
Joined: 19 Aug 2010, 00:19
Location: Little Rock, AR USA


Return to Installation and Maintenance of FreeBSD Ports or Packages

Who is online

Users browsing this forum: No registered users and 1 guest