Tiny Core Linux

Tiny Core Extensions => TCE Talk => Topic started by: SecLeVrai on August 04, 2025, 09:14:27 AM

Title: Install PHP on TC CorePlus 16
Post by: SecLeVrai on August 04, 2025, 09:14:27 AM
Hello,

I am a new user on TinyCore and would like to set up a LAMP. For this, I installed Apache2.4 and MariaDB without problems, but when installing PHP, I can’t find anything. Indeed, I downloaded php-8.3-ext and php-8.3-mod but I can’t make PHP work (I try to put a test page with phpinfo() but it doesn’t put the desired page). Can someone help me to set up PHP on my TinyCore? (I am on TinyCore CorePlus 16)
Thank you 🙏.

My php.php :
https://image.noelshack.com/fichiers/2025/32/1/1754313213-capture-d-cran-2025-08-04-151233.png
https://image.noelshack.com/fichiers/2025/32/1/1754313252-capture-d-cran-2025-08-04-151408.png
Title: Re: Install PHP on TC CorePlus 16
Post by: andyj on August 06, 2025, 11:12:12 PM
The extensions have the software and sample configuration files. Did you enable PHP in your httpd.conf file? Have you enabled server-info in your httpd.conf file? If so does it show the PHP module, like this:

Code: [Select]
Module Name: mod_php.c
Content handlers: yes
Configuration Phase Participation: Create Directory Config, Merge Directory Configs
Request Phase Participation: Content Handlers
Module Directives:
php_value - PHP Value Modifier
php_flag - PHP Flag Modifier
php_admin_value - PHP Value Modifier (Admin)
php_admin_flag - PHP Flag Modifier (Admin)
PHPINIDir - Directory containing the php.ini file
Current Configuration:
Title: Re: Install PHP on TC CorePlus 16
Post by: SecLeVrai on August 07, 2025, 10:08:55 AM
The extensions have the software and sample configuration files. Did you enable PHP in your httpd.conf file? Have you enabled server-info in your httpd.conf file? If so does it show the PHP module, like this:

Code: [Select]
Module Name: mod_php.c
Content handlers: yes
Configuration Phase Participation: Create Directory Config, Merge Directory Configs
Request Phase Participation: Content Handlers
Module Directives:
php_value - PHP Value Modifier
php_flag - PHP Flag Modifier
php_admin_value - PHP Value Modifier (Admin)
php_admin_flag - PHP Flag Modifier (Admin)
PHPINIDir - Directory containing the php.ini file
Current Configuration:

Hello!
I put below the lines that I added to my file httpd.conf, in order to activate the PHP module, and I did not manage to activate server-info.
As soon as I want to restart my apache with the two lines concerning php, an error message appears. The path to the php module seems good to me while checking.
Code: [Select]
LoadModule php8_module modules/mod_php8.so
AddType application/x-httpd-php .php

Here is the screenshot of my error: https://prnt.sc/9Ohd9MdiPaEV
Title: Re: Install PHP on TC CorePlus 16
Post by: Rich on August 07, 2025, 10:36:26 AM
Hi SecLeVrai
See if installing  acl.tcz  helps.
Title: Re: Install PHP on TC CorePlus 16
Post by: SecLeVrai on August 07, 2025, 12:16:07 PM
Hi SecLeVrai
See if installing  acl.tcz  helps.

Hi Rich!
Yes, the ACL installation helps and now shows another error, not related to file access but I feel like it leads to an error in the lines I entered in httpd.conf. I tried to read what was in mod_php8.so to see if another syntactic was to be put but the file is unreadable.
I am sending you a screenshot of the current error (https://prnt.sc/o28eYcn4beVM (https://prnt.sc/o28eYcn4beVM))
Title: Re: Install PHP on TC CorePlus 16
Post by: Rich on August 07, 2025, 09:11:10 PM
Hi SecLeVrai
Does line 66 in /usr/local/etc/httpd/httpd.conf include something like this:
Code: [Select]
LoadModule php8_module
If it does, try changing that part to:
Code: [Select]
LoadModule php_module
Then restart apache:
Code: [Select]
/usr/local/etc/init.d/httpd force-restart
Title: Re: Install PHP on TC CorePlus 16
Post by: andyj on August 08, 2025, 08:40:39 AM
Look in /usr/local/etc/httpd/original. That's where you will find the original sample files. Copy the files you need from original/conf.d to conf.d, like httpd-info.conf and httpd-php8-mod.conf.

Add the following to your httpd.conf file:

Code: [Select]
# Real-time info on requests and configuration
LoadModule info_module modules/mod_info.so                 
Include /usr/local/etc/httpd/conf.d/httpd-info.conf

# PHP 8
Include /usr/local/etc/httpd/conf.d/httpd-php8.conf
Title: Re: Install PHP on TC CorePlus 16
Post by: SecLeVrai on August 08, 2025, 05:10:13 PM
Oh okay! I hadn’t noticed these files. Indeed, it allows to go much faster! Thank you very much for your help 🙏 !