• 0

htaccess and mod_php


Question

I recently moved hosts, and can't seem to find the answer on why things aren't working, but think I have a clue why.

I use my .htaccess to modify the php.ini (shared host) with things like:

<IfModule mod_php4.c>
php_value upload_max_filesize 11M
php_value max_execution_time 800
php_value post_max_size 64M
</IfModule>

which always worked on the old server, but since going from PHP4 to PHP5 (even modifying the first line doesn't work

<IfModule mod_php5.c>

I noticed the upload_tmp_dir in my is set to "no value" the same thing that gave me problems in the past, but that was over 2 years ago.

I have tried:

ini_set('upload_tmp_dir', '/Storage/tmp/');

but to no success.

Anyone got any idea how I can modify my php.ini?

Link to comment
https://www.neowin.net/forum/topic/715626-htaccess-and-mod_php/
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I do something similar on PHP5 but I don't use the first and last lines in your example, just put the php_value lines in and give it a go.

If the new host has something like suPHP set up you won't be able to use php_value commands in your htaccess file, but you should be able to create a file called php.ini to put the commands in - this will over ride the server php.ini with your values.

TO see if there is a problem with suPHP look in your error log in the control panel (if you have any!) - if you see something like 'invalid command php_value ' you are on a box with suPHP meaning you will have to use the php.ini method

HTH

  • 0

I contacted my host, and they never gave me a solid answer, but did provide a solution for me, by adding a php.ini, and modifying the original php.ini so it can also read the new custom one.

  • 0
  admin2gd1 said:
Try using this instead.

<IfModule mod_rewrite.c>

He's not looking to do any rewriting, at least he hasn't stated this.

This could be caused by a number of things, but I would try what your host actually stated. While .htaccess may work, I believe it's possible to restrict PHP configuration changes via .htaccess, especially when it comes to the upload limit; hosts don't like letting anyone set that to whatever they want.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Perplexity starts testing its Comet AI browser on Windows by Usama Jawad AI is all the rage these days with Microsoft heavily pushing Copilot, Google investing its efforts in Gemini and Veo, Apple still figuring out Apple Intelligence, and OpenAI continuing to dominate the headlines. Now, another player in this space, Perplexity, has decided that it wants a bigger chunk of the market too. We already know that Perplexity is interested in the browser market. In May, it rolled out a version of its AI browser, Comet, exclusively to Mac customers running Apple Silicon. As expected, this piece of software features AI capabilities front and center, including the ability to engage in conversations with the AI model in natural language, surface emails that you haven't responded to, and a "Try on" feature that enables users to upload a picture of themselves and then see AI-generated images of themselves with different pieces of clothing, just to get an idea of how aesthetic they could look if they wear certain garments. Now, Perplexity CEO Aravind Srinivas has posted on X (formerly Twitter) that testing for the Windows version of Comet has now begun: Now that the testing for Comet on Windows has begun with a handful of testers, it will be interesting to see when the browser will roll out generally to customers and what feature set will eventually become available for the masses. That said, it is important to note that AI browser is not a novel concept; Opera Neon was recently announced as the first "AI agentic" browser. On a side note, Perplexity has been in hot waters recently. It received backlash from people after it revealed plans to find out everything its customers do online so that it can present them hyper-personalized ads. UK news outlet BBC also threatened the firm with legal action over its content scraping practices. Via: Engagdet
    • probably because these will be a minority compared to our general tech coverage, plus these stories, their premises do seem quite interesting.
    • Will Indian government upgrade my PC to Windows 11 if it's not supported? If they can't they should've mentioned alternatives as well.
  • Recent Achievements

    • First Post
      Brett76 earned a badge
      First Post
    • One Year In
      78andyp earned a badge
      One Year In
    • One Month Later
      Cottonbud earned a badge
      One Month Later
    • One Month Later
      langat earned a badge
      One Month Later
    • One Month Later
      Nullun earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      598
    2. 2
      ATLien_0
      219
    3. 3
      Michael Scrip
      197
    4. 4
      +FloatingFatMan
      144
    5. 5
      Xenon
      135
  • Tell a friend

    Love Neowin? Tell a friend!