LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-15-2010, 01:55 PM   #1
Bobcat3Romeo1
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Rep: Reputation: 0
Question using PHP inside of HTML on a Slackware server,


My website is domaintoolscentral dot com, I want to use PHP inside of my HTML pages but I can't seem to figure it out. I know it has to do with the httpd.conf file or I think it does. I do not want to use a .htacess file.
 
Old 06-15-2010, 02:31 PM   #2
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 128Reputation: 128
in your php mod file or httpd php section replace this

Code:
<IfModule mod_php5.c>
  AddType application/x-httpd-php .php .phtml .php3
  AddType application/x-httpd-php-source .phps
</IfModule>
by this

Code:
<IfModule mod_php5.c>
  AddType application/x-httpd-php .php .phtml .php3 .htm .html
  AddType application/x-httpd-php-source .phps
</IfModule>
And remove the link to your domaine, if you want to advertise, do it the official way
 
1 members found this post helpful.
Old 06-15-2010, 02:37 PM   #3
BirdRacer
LQ Newbie
 
Registered: Feb 2008
Posts: 14

Rep: Reputation: 2
IF you have PHP installed.

You will also need these:

LoadModule php5_module modules/libphp5.so
DirectoryIndex index.php index.html
 
1 members found this post helpful.
Old 06-16-2010, 06:18 AM   #4
Bobcat3Romeo1
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Smile

Thank you very much for the help.
 
Old 06-16-2010, 08:36 AM   #5
Bobcat3Romeo1
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Original Poster
Rep: Reputation: 0
We did all the changes and still cannot fire php inside of html. Any suggestions?
 
Old 06-16-2010, 08:51 AM   #6
BirdRacer
LQ Newbie
 
Registered: Feb 2008
Posts: 14

Rep: Reputation: 2
Are you sure PHP is installed?

Do "locate libphp" and post the results.

Note above I have libphp5.so That is for PHP5. If you have PHP4 installed, it will be libphp4.so
 
1 members found this post helpful.
Old 06-16-2010, 11:02 AM   #7
Bobcat3Romeo1
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Are you sure PHP is installed?

The file libphp5.so is located usr/lib64/httpd/modules/libphp5.so
 
Old 06-16-2010, 12:43 PM   #8
BirdRacer
LQ Newbie
 
Registered: Feb 2008
Posts: 14

Rep: Reputation: 2
In the httpd.conf file, what is "ServerRoot" set to? If it is /usr/lib64/httpd, then you should be set.

You say you can't get PHP to "Fire". How are you testing it?
 
1 members found this post helpful.
Old 06-16-2010, 01:22 PM   #9
Bobcat3Romeo1
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Original Poster
Rep: Reputation: 0
php firing instide of HTML

OK we check the httpd.conf and the ServerRoot" was set to /usr, so we changed the ServerRoot" /usr/lib64/httpd, and now we get a syntax error line 54.

PhP is firing however if you use PhP inside of a HTML page then the php will not work. We are using Slackware.

I have used PhP inside of HTML pages before but cannot on the server we just built.
 
Old 06-16-2010, 02:08 PM   #10
BirdRacer
LQ Newbie
 
Registered: Feb 2008
Posts: 14

Rep: Reputation: 2
PHP doesn't "Fire". It's not a daemon or application that runs in the background. It works on the fly, processing the embedded code. I guess to get your webserver running again, you need to change the ServerRoot back to /usr.

Create an index.html page with the following code:

Code:
<html>
<body>

<?php
phpinfo(); 
?>

</body>
</html>
Place this index.html file in the directory that is specified by the "DocumentRoot" directive in your httpd.conf file. With a web browser, visit that index.html page, i.e. http://localhost/index.html, or however you connect to your webserver, and see if you get all the PHP info, parameters, etc.

If this doesn't work, try to change the line that reads:
LoadModule php5_module modules/libphp5.so
to
LoadModule php5_module lib64/httpd/modules/libphp5.so

Restart apache, and try to visit the index.html page again. Let me know if either of these work.

Did you compile Apache for use with PHP, and did you compile PHP for use with Apache, or were these RPM or similar packages that you installed? They may not be working together properly.

If you are not comfortable compiling from source code, there is a package called XAMPP that is a standalone Apache webserver with PHP, Perl, and MySQL that may be easier for you to use for testing, until you can get your Apache/PHP installation straightened out. The website for XAMPP is http://www.apachefriends.org/en/xampp.html.
 
1 members found this post helpful.
Old 06-16-2010, 04:47 PM   #11
Bobcat3Romeo1
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Cool Much Thanks,

Everything is now fixed and running perfect thanks to all of you who are much, much smarter than I. I appreciate everything you did. Warm regards.
 
Old 06-16-2010, 04:52 PM   #12
BirdRacer
LQ Newbie
 
Registered: Feb 2008
Posts: 14

Rep: Reputation: 2
Glad to hear it. Out of curiosity, what fixed it?

It might be helpful information to someone else with the same problem.
 
1 members found this post helpful.
Old 06-17-2010, 07:07 AM   #13
Bobcat3Romeo1
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Actually we did not fix the problem of running php on a html page. A programmer in Romania built the server using Slackware, he was a very smart programmer but knew nothing about SEO, he had every page showing the first four words of the title being the same via the templates. Anyway we finally figured out his template system, fixed the problem and now we can change the titles on every page to be different.

I would still like to get the php to work on html pages but between my son and I we aren't really programmers and I am afraid we will mess up our server. If anyone knows someone in the Nashville, Tennessee area then please have them contact me. I still want it fixed. Once again thank you to all who helped, just knowing everyone is out there waiting to help is awesome.
 
Old 06-17-2010, 08:17 AM   #14
BirdRacer
LQ Newbie
 
Registered: Feb 2008
Posts: 14

Rep: Reputation: 2
I'm about 85 miles South of Nashville on the TN/AL line. About an hour and a half away up I-65. :-)

Last edited by BirdRacer; 06-17-2010 at 08:19 AM.
 
1 members found this post helpful.
Old 06-18-2010, 06:19 AM   #15
Bobcat3Romeo1
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks BirdRacer. Let me figure out my schedule and get back with you. What days/hours are you available?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] unknown module in my server to get PHP errors in HTML tables jstitch Linux - Server 1 06-08-2010 05:55 PM
Html tags inside PHP mail body message. linuxlover.chaitanya Programming 7 03-12-2010 01:50 AM
Where to put index.php (or index.html) on Slackware 11.0 moonguide Slackware 3 05-08-2007 07:35 PM
how to print my CGI programs output inside an HTML zaveko Programming 9 10-11-2005 06:37 PM
simple q: can you use php inside an html document? BrianK Programming 2 12-10-2004 10:31 PM


All times are GMT -5. The time now is 06:45 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration