Koozali.org: home of the SME Server

PHP does not run

Martin Hansen

PHP does not run
« on: August 05, 2002, 12:51:07 AM »
I have created a test4.php, that does someting. It works nicely on a server, that runs php out there somewhere.
But when I try to run it on the E-smith (4.1.2) nothing happens. I store it in the html directory.
What's wrong?

Nathan Fowler

Re: PHP does not run
« Reply #1 on: August 05, 2002, 06:11:36 AM »
In E-Smith 4.1.2 PHP is the primary directory is disabled.  If you require PHP in the primary directory (/home/e-smith/files/primary/html) you can do the following:

From console:
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
pico -w 95AddType10PHPprimary
  [Add these lines]
#Add PHP support to the Primary website

    AddType application/x-httpd-php .php .php3 .phtml
    AddType application/x-httpd-php-source .phps

  [Save changes and close]
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
/etc/rc.d/init.d/httpd restart
/etc/rc.d/init.d/httpd-admin restart

You should now have PHP support in the primary html directory.  This change is not necessary for the ibays, as you can define PHP/CGI support from the e-smith manager.

Hope this helped,
Nathan

Patrick

Re: PHP does not run
« Reply #2 on: August 11, 2002, 09:18:07 AM »
Nathan,

I tried your suggestion and it didn't work. rebooted the computer as well. Did it work for anyone else?Nathan Fowler wrote:
>
> In E-Smith 4.1.2 PHP is the primary directory is disabled.
> If you require PHP in the primary directory
> (/home/e-smith/files/primary/html) you can do the following:
>
> From console:
> mkdir -p
> /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
> cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
> pico -w 95AddType10PHPprimary
>   [Add these lines]
> #Add PHP support to the Primary website
>
>     AddType application/x-httpd-php .php .php3 .phtml
>     AddType application/x-httpd-php-source .phps
>

>   [Save changes and close]
> /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
> /etc/rc.d/init.d/httpd restart
> /etc/rc.d/init.d/httpd-admin restart
>
> You should now have PHP support in the primary html
> directory.  This change is not necessary for the ibays, as
> you can define PHP/CGI support from the e-smith manager.
>
> Hope this helped,
> Nathan

Nathan Fowler

Re: PHP does not run
« Reply #3 on: August 12, 2002, 03:21:40 AM »
Are you naming your files with a .php, .php3, or .phtml extension?

Thanks,
Nathan

Patrick

Re: PHP does not run
« Reply #4 on: August 13, 2002, 03:46:17 AM »
The pages are in html, but the scripts are in php extentions

Nathan Fowler

Re: PHP does not run
« Reply #5 on: August 13, 2002, 05:48:50 AM »
Did you write these or are they prefab?  Do they have opening and closing PHP delimeter tags?

Patrick

Re: PHP does not run
« Reply #6 on: August 13, 2002, 10:57:08 AM »
They're basically prefab, but I changed the directories so they point correctly.

      include "./counter/phphits.php";
      phphitsAddHit();
   ?>

This coding works on an Ibay but not in the main html folder.