• 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

    • I think you need to adjust your style of approach. While some were affected by performance issues, and it's not a huge gap... you're acting as if Ryzen couldn't handle 11 at all. Performance issues are purely based on some facts in certain scenarios, while others are not. I see one link with a handful of people discussing the topic. I didn't join those topics or seek them out myself, as I didn't encounter noticeable drops in performance going from 10 to 11. It might also have to be because I don't have my nose stuck up the butt of single digit percentage points. I don't benchmark my PC every time something new comes out. Single percentage point differences in performance only ruffle the feathers of those that don't care about daily use. If you have a race car, do you compare that to your daily driver? Do you expect your Honda Accord to break the 9 second quarter mile like your 1000HP Pontiac Firebird? If you're so worried about FPS instead of enjoying your games... perhaps opening a curtain in your basement might provide a new perspective in life.
    • Currently updating my Win10 IoT Enterprise LTSC 2021 in a VM (QEMU/KVM) on Linux. but damn, updates take forever (makes me appreciate the lightness on Linux all the more). to give you a general idea... this update finished at 37 minutes into system uptime and I would estimate updates have been running roughly 20-30 minutes (some of this would be download time, but even subtracting that I would guess that 20-30min is close). granted, I only got two cores of my four core CPU (i5-3550) dedicated to the VM. but still, Linux wipes the floor with Windows in this regard.
    • It's disgusting that this exists and is being marketed by Neowin as a way to earn passive income. Support real writers and real arts. The world needs them more than ever. After at least 10 years, Neowin can GTFO my favorites bar.
    • It doesn't have to be "interesting" for a script/bot to just copy everything it finds and rehost it on another site. I hope you remember your post when AGI replaces not only your job and your career, but you entirely in the workforce...
  • Recent Achievements

    • Reacting Well
      rshit earned a badge
      Reacting Well
    • Reacting Well
      Alan- earned a badge
      Reacting Well
    • Week One Done
      IAMFLUXX earned a badge
      Week One Done
    • One Month Later
      Æhund earned a badge
      One Month Later
    • One Month Later
      CoolRaoul earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      531
    2. 2
      ATLien_0
      272
    3. 3
      +FloatingFatMan
      211
    4. 4
      +Edouard
      202
    5. 5
      snowy owl
      140
  • Tell a friend

    Love Neowin? Tell a friend!