Jump to content

PHP5 in Mandriva 2007 Free Spring


Guest TheCrow
 Share

Recommended Posts

Guest TheCrow

Hi, I'm having a slight problem getting php5 working. I tried to do a bit of php programming and when i opened the file in firefox I get a popup asking me to download the php script. So I figured I just need to install php. So I downloaded the lastest version of php source file. Then followed the instructions in the install file, untill near the end. I have the problem that says apache could not load module "libphp5.so" because the file does not exist. In fact this file was never created (I searched for it), when I googled this problem i find that you can fix this by installing http-devel. Unfortunately I have only been able to find this for redhat and fedora, none for Mandriva. What do I do to fix my problem?

Thanks in Advanced.

TheCrow

 

BTW I'm kinda new to Linux haven't used it a whole lot, so please try to keep the explanations very basic. Thanks.

Edited by TheCrow
Link to comment
Share on other sites

Guest TheCrow

[howie@localhost ~]$ rpm -qa | grep apache

apache-mod_perl-2.0.2-8mdv2007.0

apache-mod_php-5.1.6-2mdv2007.0

apache-doc-2.2.3-1mdv2007.0

apache-conf-2.2.3-3mdv2007.0

apache-modules-2.2.3-1mdv2007.0

apache-mod_cache-2.2.3-1mdv2007.0

apache-base-2.2.3-1mdv2007.0

apache-mod_ssl-2.2.3-1mdv2007.0

apache-mod_suexec-2.2.3-1mdv2007.0

apache-mpm-prefork-2.2.3-1mdv2007.0

 

 

 

 

 

[howie@localhost ~]$ rpm -qa | grep php

php-ini-5.1.6-1mdv2007.0

php-xmlreader-5.1.6-1mdv2007.0

apache-mod_php-5.1.6-2mdv2007.0

php-iconv-5.1.6-1mdv2007.0

php-pgsql-5.1.6-1mdv2007.0

php-pear-HTML_Template_IT-1.1.4-1mdk

php-pear-Image_Color-1.0.2-2mdk

php-pear-Translation2-2.0.0-8mdk

php-pear-HTML_Progress-1.2.5-2mdk

php-cgi-5.1.6-1mdv2007.0

lib64php5_common5-5.1.6-1mdv2007.0

php-session-5.1.6-1mdv2007.0

php-sysvsem-5.1.6-1mdv2007.0

php-xml-5.1.6-1mdv2007.0

php-mysql-5.1.6-2mdv2007.0

php-pear-Date-1.4.6-1mdk

php-pear-XML_Serializer-0.18.0-2mdk

php-pear-PHP_Compat-1.5.0-1mdk

php-pear-HTTP_Request-1.3.0-2mdk

php-gettext-5.1.6-1mdv2007.0

php-posix-5.1.6-1mdv2007.0

php-sysvshm-5.1.6-1mdv2007.0

php-ldap-5.1.6-1mdv2007.0

php-pear-HTML_Common-1.2.2-2mdk

php-pear-Var_Dump-1.0.3-1mdk

php-pear-Validate-0.6.3-1mdk

php-pear-HTML_Page-2.0.0-7mdk

php-pear-Cache_Lite-1.7.1-1mdk

php-pear-Text_Highlighter-0.6.9-1mdk

php-pear-HTML_Template_Flexy-1.2.4-1mdk

php-pear-HTML_Template_Sigma-1.1.4-2mdk

php-ftp-5.1.6-1mdv2007.0

php-pcre-5.1.6-1mdv2007.0

php-tokenizer-5.1.6-1mdv2007.0

php-cli-5.1.6-1mdv2007.0

php-xmlrpc-5.1.6-1mdv2007.0

php-gd-5.1.6-1mdv2007.0

php-readline-5.1.6-1mdv2007.0

php-pear-XML_Util-1.1.1-8mdk

php-pear-Net_FTP-1.3.2-1mdk

php-pear-DB_DataObject-1.7.15-5mdk

php-pear-HTML_Table-1.7.0-1mdk

php-pear-PEAR_Command_Packaging-0.1.2-1mdv2007.0

php-pear-I18Nv2-0.11.4-1mdk

php-pear-HTML_QuickForm-3.2.5-2mdk

php-pear-HTML_QuickForm_Controller-1.0.5-2mdk

php-ctype-5.1.6-1mdv2007.0

php-simplexml-5.1.6-1mdv2007.0

php-smarty-2.6.14-1mdv2007.0

php-imap-5.1.6-1mdv2007.0

php-pear-MDB2-2.2.1-2mdv2007.0

php-pear-Config-1.10.6-1mdk

php-pear-Console_ProgressBar-0.2-7mdk

php-pear-Net_URL-1.0.14-8mdk

php-hash-5.1.6-1mdv2007.0

php-xmlwriter-5.1.6-1mdv2007.0

lib64c-client-php0-2004g-2mdv2007.0

php-pear-5.1.6-1mdv2007.0

php-pear-MDB-1.3.0-8mdk

php-pear-File_Gettext-0.3.4-2mdk

php-pear-HTML_Javascript-1.1.1-2mdk

php-pear-PEAR_RemoteInstaller-0.3.0-1mdk

Link to comment
Share on other sites

Guest TheCrow
well, your webserver seems to be set up right.

 

what do you get if you browse to this address?

 

http://localhost/

 

 

It says "It Works!", however still if i browse to a php script it wants to download it instead of displaying it. I know it doesn't work because it's missing libphp5.so which is specified in the httpd.conf file, when you install php5. And thats why it can't read the scripts, however It won't build the libphp5.so file for some reason, and I can't find that file on the internet. So If anyone could help it would be very much apreciated thanks,

 

TheCrow

Link to comment
Share on other sites

Could you please demonstrate where libphp5.so is specified in the httpd.conf file?

 

You are making this more difficult than it has to be. There is no need to compile anything. Everything you need to get php5 running on apache in Mandriva can be installed through rpmdrake (Software Management in Mandriva Control Center).

 

If you have somehow installed apache and/or php5 through a tar.gz, then it may have put things in your httpd.conf that do not need to be there.

 

This is what I have installed on a working config:

[root@localhost ohms]# rpm -qa | grep apache
apache-modules-2.2.4-6.2mdv2007.1
apache-conf-2.2.4-4mdv2007.1
apache-mpm-prefork-2.2.4-6.2mdv2007.1
apache-devel-2.2.4-6.2mdv2007.1
apache-base-2.2.4-6.2mdv2007.1
apache-mod_php-5.2.1-4mdv2007.1
[root@localhost ohms]# rpm -qa | grep php
php-hash-5.2.1-1mdv2007.1
php-openssl-5.2.1-4.2mdv2007.1
php-posix-5.2.1-1mdv2007.1
php-xmlreader-5.2.1-1mdv2007.1
lib64php5_common5-5.2.1-4.2mdv2007.1
php-simplexml-5.2.1-1mdv2007.1
php-session-5.2.1-1mdv2007.1
php-gettext-5.2.1-1mdv2007.1
php-sysvshm-5.2.1-1mdv2007.1
php-ftp-5.2.1-1.1mdv2007.1
php-ctype-5.2.1-1mdv2007.1
php-sysvsem-5.2.1-1mdv2007.1
php-filter-5.2.1-0.1mdv2007.1
php-gd-5.2.1-1mdv2007.1
php-ini-5.2.1-2mdv2007.1
php-tokenizer-5.2.1-1mdv2007.1
php-zlib-5.2.1-4.2mdv2007.1
php-timezonedb-2007.3-1mdv2007.1
php-xmlwriter-5.2.1-1mdv2007.1
php-json-1.2.1-3mdv2007.1
php-suhosin-0.9.18-4mdv2007.1
apache-mod_php-5.2.1-4mdv2007.1

 

Of course, some of those php pkgs may be superfluous to your needs.

Edited by Steve Scrimpshire
Link to comment
Share on other sites

Guest TheCrow

ok, since i seem to have tried this the hard way... would you mind explaining how I would use rpmdrake. I'm assuming this would require an rpm file of php5, which I have searched for before using the tar.gz file I downloaded off the php website. If you could explain the process of installing it using rpmdrake and where you got the rpm file of php5 I would be greatly apreciative. Thanks for the reply.

 

TheCrow

Link to comment
Share on other sites

I am not sure what you need. For example I usually use the urpmf command to locate a specific file on the mandriva sources. I also download mlocate to locate the files on my filesystem.

 

So first step:

# urpmf libphp
libphp5_common5:/usr/lib/libphp5_common.so.5
libphp5_common5:/usr/lib/libphp5_common.so.5.2.0
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/CREDITS
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/CREDITS.libxml
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/CREDITS.zlib
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/INSTALL
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/LICENSE
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/NEWS
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.EXTENSIONS
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.EXT_SKEL
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.PARAMETER_PARSING_API
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.PHP4-TO-PHP5-THIN-CHANGES
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.STREAMS
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.UPDATE_5_2
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.input_filter
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.openssl
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.spl
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/ZEND_LICENSE
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/configure_command
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/php.ini-dist
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/php.ini-recommended
php-devel:/usr/lib/libphp5_common.la
php-devel:/usr/lib/libphp5_common.so
php-devel:/usr/src/php-devel/sapi/apache/libphp5.module.in
php-devel:/usr/src/php-devel/sapi/apache_hooks/libphp5.module.in
libphp5_common5:/usr/lib/libphp5_common.so.5
libphp5_common5:/usr/lib/libphp5_common.so.5.2.0
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/CREDITS
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/CREDITS.libxml
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/CREDITS.zlib
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/INSTALL
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/LICENSE
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/NEWS
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.EXTENSIONS
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.EXT_SKEL
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.PARAMETER_PARSING_API
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.PHP4-TO-PHP5-THIN-CHANGES
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.STREAMS
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.UPDATE_5_2
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.input_filter
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.openssl
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/README.spl
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/ZEND_LICENSE
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/configure_command
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/php.ini-dist
libphp5_common5:/usr/share/doc/libphp5_common5-5.2.1/php.ini-recommended
php-devel:/usr/lib/libphp5_common.la
php-devel:/usr/lib/libphp5_common.so
php-devel:/usr/src/php-devel/sapi/apache/libphp5.module.in
php-devel:/usr/src/php-devel/sapi/apache_hooks/libphp5.module.in

 

So it seems there is the libphp5_common5 that you can check if you are missing or not by doing the:

rpm -qa |grep libphp5

 

No need to use locate because we already know the path to the library. But I will put the apache snippet on php that is at /etc/httpd/modules.d/70_mod_php.conf.

<IfDefine HAVE_PHP5>
<IfModule !mod_php5.c>
	LoadModule php5_module	extramodules/mod_php5.so
</IfModule>
</IfDefine>

<IfModule mod_mime.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps
</IfModule>

<IfModule mod_php5.c>
<IfModule mod_dir.c>
	DirectoryIndex index.php index.phtml
</IfModule>
</IfModule>

 

We can see that the library is actually on extramodules/mod_php5.so now you can do a locate (if you dont have it download mlocate). If you find it then everything shoudl work but if you dont have it probably an apache package was missing.

Link to comment
Share on other sites

By default, your system should be set up to use your install medium for an install source. Just go to your menu and choose Configure Your Computer, enter your root password and go to Software Management -> Look at an install installable packages. You will be able to find and install apache and php there.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...