cd /etc/httpd/extramodules
sudo ln -s mod_php5.so.5 mod_php5.so

and restart

On 08/05/15 22:04, Barry wrote:
Hi Andrew,

That is the complete body of my test php file.

Tonight when I run 'systemctl status httpd.service' it fails with the following error msg...

"May 08 20:33:40 TheBox httpd[4312]: Starting httpd: httpd: Syntax error on line 305 of /etc/httpd/conf/httpd.conf: Syntax error on line 2 of /etc/httpd/modules.d/70_mod_php.conf: Cannot load /etc/httpd/extramodules/mod_php5.so into server: libphp5_common.so.5: cannot open shared object file: No such file or directory"

mod_php.so.5 is in/etc/httpd/extramodules/ & in/usr/lib/apache-extramodules/
libphp5_common.so.5 is in /usr/lib/
libphp5.so is in /usr/lib

Looks like errors in httpd.conf, & inmodules.d/70_mod_php.conf but my head is screwed for tonight!

Thanks

Barry
-------------------------------------------
On 08/05/15 01:08, Andrew Sands wrote:
Barry,

Is that the complete code because after checking on a VM here with apache installed (Ok, so it's Debian), I have a file called 'index.php' which contains only the line '<?php phpinfo(); ?>'

I did a quick Google search [0] and found the following, which I put in a file called "hello.php"
<html>
  <head>
   <title>PHP Test</title>
  </head>
  <body>
  <?php echo '<p>Hello World</p>'; ?>
  </body>
</html>

For reviewing dot conf files on the command line, you could always try ' egrep -v '^(#|$)' filename' [1]

regards,

Andrew

[0] Google search: simple first php program - First hit is: http://php.net/manual/en/tutorial.firstpage.php
[1] Google search: ignore commented lines in conf file linux
I went with: http://www.linuxquestions.org/questions/linux-newbie-8/how-can-i-cat-or-grep-a-file-to-ignore-lines-starting-with-654683/



On 07/05/15 23:48, Barry wrote:
Thanks Chris  for your reply

What distro?
Mageia2 32 bit running on a 64 bit box. Its old but mageia 4 64 bit pkg is corrupt and insists on loading 32 bit libraries. I have the 2 versions bootable

Apache2.2.25
PHP5.3.27

Change your <?phpinfo ?> to be:

<?php

phpinfo();

?>
This is my code......
-----------------------
<body>
<h1>Apache works!!!!!</h1>
<?php
PHP works!; <BR>
phpinfo();
?>
</body>
--------------------
This when 1st loaded gives.....(copied from screen)

Apache works!!!!!
 phpinfo(); ?>
---------------------------
If I refresh the screen opera wants to download the file. I think there is either a missing pkg or a missing line in the .conf files, but which????

Barry
------------------------------------------------------------------------------------------------
If that dunnae work, some more detail on distro etc and I'm sure we can get you working quickly.

Cheers, Chris H.

On 07/05/15 20:54, Barry wrote:
Hi all,
After trying for abt 3 weeks to get php running I am just about tearing what little hair I have left out. I can not get php coding recognized in a .php file. Steps taken so far......

Set up '127.0.0.1    localhost' in /etc/hosts.allow
Amended http.conf to recognise files with .php suffix
Scanned http.conf and php.conf.
Searched the web for help.

Apache now recognizes both/either 127.0.0.1 and localhost in the address bar,
also file.html and file.php.

With an entry like <?phpinfo ?>, the >?php is dropped, the rest of the line being recognised as text.

Both http.conf and php.conf have so much in the way of explanatory comments in them that the active lines in each of them are well separated and can not be read together in a group.


_______________________________________________
Linux-users mailing list
Linux-users@lists.canterbury.ac.nz
http://lists.canterbury.ac.nz/mailman/listinfo/linux-users


_______________________________________________
Linux-users mailing list
Linux-users@lists.canterbury.ac.nz
http://lists.canterbury.ac.nz/mailman/listinfo/linux-users

_______________________________________________
Linux-users mailing list
Linux-users@lists.canterbury.ac.nz
http://lists.canterbury.ac.nz/mailman/listinfo/linux-users


_______________________________________________
Linux-users mailing list
Linux-users@lists.canterbury.ac.nz
http://lists.canterbury.ac.nz/mailman/listinfo/linux-users

_______________________________________________
Linux-users mailing list
Linux-users@lists.canterbury.ac.nz
http://lists.canterbury.ac.nz/mailman/listinfo/linux-users

Reply via email to