1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP Installation & Configuration

Discussion in 'Installation and Maintenance of Ports or Packages' started by rtwingfield, Aug 19, 2010.

  1. rtwingfield

    rtwingfield New Member

    Messages:
    109
    Thanks Received:
    0
    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.
     
  2. cuq

    cuq New Member

    Messages:
    33
    Thanks Received:
    5
    hi rtwingfield,
    mines are in /usr/local/etc
    but from man php it seems that you can tell where: --php-ini path|file or -c path|file
    i have php 5.3.
    hope this help
    cheers
    cuq
     
  3. gilinko

    gilinko New Member

    Messages:
    416
    Thanks Received:
    52
    It does copy the two example files php.ini-development and php.ini-production 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.
     
  4. rtwingfield

    rtwingfield New Member

    Messages:
    109
    Thanks Received:
    0
    Thanks for the suggestion. Actually . . .FYI, the two distribution files are php.ini-dist and php.ini-recommended. I copied the php.ini-recommended to php.ini, 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 ./SMF/install.php failing. I'm pursuing that problem via the SMF forum.http://www.simplemachines.org/community/index.php?topic=396672.0
     
  5. amitabh

    amitabh New Member

    Messages:
    25
    Thanks Received:
    4
    From the SMF Forums, it seems that PHP is not configured with Mysql correctly. The TestDB page should only contain "phpinfo();" 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 php -i|grep mysql to check if you have mysql correctly configured. Also it would make sense to check if you ahve the mysql extension for PHP installed (pkg_info | grep php5-mysql)
     
  6. rtwingfield

    rtwingfield New Member

    Messages:
    109
    Thanks Received:
    0
    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, session_start(), et al? I have installed WebCalendar 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 phpinfo() anywhere for test purposes . . .it will insert itself after and before anything that follows. The testdb.php thing is just a proof-of-concept thing that I cobbled up :)

    Thanks,
    RW