DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 3rd June 2013
yce44 yce44 is offline
New User
 
Join Date: Jun 2013
Posts: 2
Thanked 0 Times in 0 Posts
Default openbsd 5.3 - php not working

Hello,

I can't make php works on an openbsd5.3 box. The php files are displayed as plain text files, or even worst, I'm asked if I want to download them, it seems that the server not parse at all the php code.
After installing the OS, I followed a tutorial for installing the MySQL and PHP support for it, installing the latest packages available (pkg_add). I can't post the link to it since this is my first post here .
Everything installed with no problems, I did created the suggested soft links.
I started Apache server and works. When I wanted to test php with the classic test file: <?php phpinfo(); ?> I get the file content displayed as plaint text file.

In httpd.conf I did the following changes:
- uncomment:
#AddType application/x-httpd-php .php
- add index.php to DirectoryIndex
DirectoryIndex index.html index.php

I copied the development php-5.3.ini file to /var/www/conf/php.ini

Running in term
Code:
php -v
doesn't work. I found the problem to be from the name of php binary which is /usr/local/bin/php-5.3. I created a soft link to php-5.3 as php and now
Code:
php -v
works, the output being:
Code:
PHP 5.3.21 with Suhosin-Patch (cli) (built: Feb 25 2013 20:15:10)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
    with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH
What's wrong?

Thanks for anything..
Reply With Quote
  #2   (View Single Post)  
Old 3rd June 2013
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,612
Thanked 214 Times in 189 Posts
Default

Hello, and welcome!
Quote:
...I followed a tutorial...
Generally, third-party "howto" documents you find on the web for OpenBSD are out-of-date and/or misleading.

I am betting that you missed the installation messages provided when you installed the php packages. A symbolic link is needed between the modules in /usr/local/share and your webserver.

Use the -M option of pkg_info(1) to reproduce the message for all of your installed php modules:

$ pkg_info -M /var/db/pkg/php*
Reply With Quote
  #3   (View Single Post)  
Old 3rd June 2013
yce44 yce44 is offline
New User
 
Join Date: Jun 2013
Posts: 2
Thanked 0 Times in 0 Posts
Default

You were right!
In that listing was:
ln -sf /var/www/conf/modules.sample/php-5.3.conf /var/www/conf/modules/php.conf

I did that and now it works.

Thanks a lot for your help.
Reply With Quote
  #4   (View Single Post)  
Old 3rd June 2013
LeFrettchen's Avatar
LeFrettchen LeFrettchen is offline
Marveled user
 
Join Date: Aug 2012
Location: Bronvaux, France
Posts: 107
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jggimi View Post
I am betting that you missed the installation messages provided when you installed the php packages.
Yo !

The only way to install a package is to absolutely follow the installation process provided by OpenBSD.

OpenBSD's 3 main rules :
  1. Read the OpenBSD's FAQ BEFORE doing anything,
  2. Strictly follow the pkg_add directives.
  3. Use the OpenBSD's Manuel Pages if you need informations,


After that, and only after, use the net.
Reply With Quote
Reply

Tags
apache, openbsd, php

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
My keyboard is not working properly anymore in OpenBSD newbsdied OpenBSD General 2 4th November 2010 11:20 PM
Mouse:X (not-working) and tty-Console (working), in 8.0 ykt FreeBSD General 1 22nd December 2009 12:26 PM
[ OpenBSD 4.5 ] apm -C not working wraith0x2b OpenBSD Installation and Upgrading 17 6th May 2009 09:03 AM
Working around cheap SOHO routers under OpenBSD BSDfan666 Guides 1 23rd November 2008 07:44 PM
Working Configuration for Openbsd 4.0 - Postfix - SASL - TLS roundkat Guides 0 4th May 2008 05:38 PM


All times are GMT. The time now is 01:33 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick