Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6644399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:09:46+00:00 2026-05-26T00:09:46+00:00

I have a file called init.php which I want to get automatically included in

  • 0

I have a file called init.php which I want to get automatically included in each and every HTTP request coming to my server. My server is on LAMP configuration with PHP 5.3 and fast CGI. Any method to achieve this is welcome.

What I have already tried:

I have already tried the auto_prepend_file method with .htaccess file but no success.

I have done the following.

.htaccess File:

php_value auto_prepend_file /home/user/domain.com/init.php

init.php file:

<?php
echo "statement 2";
?>

index.php file:

statement 1

So, now if I visit http://domain.com/ I find only statement 1 getting printed. statement 2 is not getting printed.

Kindly let me know how to correct this or if there is any other way to achieve this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:09:47+00:00Added an answer on May 26, 2026 at 12:09 am

    My server is on LAMP configuration with PHP 5.3 and fast CGI.

    You can not set PHP ini directives with the .htaccess method with FCGI/CGI. You need to apply the changes within the php.ini or better the user ini files Docs instead.

    Place a file called .user.ini into the document root and add the auto_prepend_fileDocs directive in there:

    auto_prepend_file = /home/user/domain.com/init.php
    

    This should do the job for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file called header.html and it is included by base.html . In
I have a file called webpart.cs which is called by one of my masterpages
I have a file called 34.php?session=2534464a39a2c97cb7113689726a4e52 in my /var/www/html folder but I can't view
I have a function called init on my website in an external file called
I'm coding a web site and I have a php fonction called site_nav.php which
I have a file called function.php that has a function like this: public function
I have a php file with different functions in it. I need to get
I have a php file, say include.php which has the following contents: <?php $myVar
I have a file called main.py and a file called classes.py main.py contains the
I have a file called hellowf.cs class MyFirstApp { static void Main() { System.Windows.Forms.MessageBox.Show(Hello,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.