Tiny Core Extensions > TCE Q&A Forum

How to enable php on apache

(1/2) > >>

flawd:
Hi

I have the following extensions installed.

Apache2.4.tcz
Apache2-mod-php5.tcz
Mariadb.tcz


I placed a index.php file in my /usr/local/apache2/htdocs folder, the php was not working. Do I need anything else to enable php or do I need to edit a config file somewhere?

Sorry if I am asking too many questions :S

gerald_clark:
Read the info file.

flawd:

--- Quote from: gerald_clark on April 10, 2015, 06:11:28 PM ---Read the info file.

--- End quote ---

Already read it.

Says to install and restart Apache and that if httpd.conf is not in the default location that I should add "Include conf/php/mod_php5.conf" to add it manually. It does not specify default location of httpd.conf so there is no way for me to tell if I need to modify it or not. I assumed that was not in the default location(since it didn't work) and added the include anyway and tried restart apache again. Didn't work.

I assume that If I have Apache2.tcz installed then installed apache2-mod-php5.tcz it will build on top of that directory then when it is restarted it should run right out of the box. The extension is from 2012 and Apache2 has been replaced by Apache2.4 since then (also needs an update to current version of php). So I do not know if anything major has changed in the directory structure or if this even compatible with Apache 2.4.

Rich:
Hi flawd
If you have not done so already, I would copy:

--- Code: ---usr/local/apache2/conf/httpd.conf.orig
--- End code ---
to:

--- Code: ---usr/local/apache2/conf/httpd.conf
--- End code ---
so that Apache has a config file. I would then search that file for php entries and see if they are commented out with a ; (semi colon).
You might also want to take a look in:

--- Code: ---usr/local/apache2/conf/php5/extensions/dist.ini.sample
usr/local/apache2/conf/php5/mod_php5.conf
usr/local/apache2/conf/php5/php.ini.sample
--- End code ---
for some guidance. Maybe copy the  .ini.sample  files to  .ini  files.

flawd:
Hey Rich, thanks for the assistance.

I have copied over the previously existing httpd.conf with httpd.conf.orig and php.ini with php.ini.sample.

I looked into mod_php5.conf and it looks like something that will help apache identify .php and .phps files?

--- Code: ---LoadModule php5_module modules/mod_php5.so
<IfModule mod_php5.c>
  AddType application/x-httpd-php .php
  AddType application/x-httpd-php-source .phps
</IfModule>

--- End code ---

The dist.ini contains a list of enabled and disabled extensions and I do not see php mentioned anywhere in there. Do I need to add it to enabled list?

If so, how do I add it? extension=???.so
I have tried extension=mod_php5.so with no luck.

Navigation

[0] Message Index

[#] Next page

Go to full version