Need help with php.ini


#1

I searched, and didn’t find anything, then the damn site would not let me search again.

I need to increase the post_max_size and upload_max_filesize in my php.ini

I have a folder named cgi-bin from php4 and I guess 5 made it quit working.

I changed the size in the ini, but it does not work. I added the following to my .htaccess and I get an error…

Options +ExecCGI
AddHandler php5-cgi .php
Action php-cgi /cgi-bin/php-wrapper.fcgi
Action php5-cgi /cgi-bin/php-wrapper.fcgi

I created an info file… http://gametechmods.com/info.php

I am clueless, can somebody help me with this?

THANKS[hr]
OK, I found this http://sxi.sabrextreme.com/dh-phpini and it worked…somewhat!!

It allows 20M, and when I downloaded the php.ini and edited it to the size I want, IT DID NOT CHANGE…

Can somebody tell me why it didn’t change?

THANKS


#2

It looks like you’re mixing regular cgi with fastcgi. I don’t know what the rest of your setup is in the cgi-bin directory, so you might want to comment out those lines from .htaccess, rename the cgi-bin directory, and start fresh.
http://sxi.sabrextreme.com/dh-phpini
This is for a site that has Fast-CGI enabled in the DH panel for your Fully Hosted Domain.


#3

That is what I used, and I just deleted EVERYTHING…the .htaccess and the cig-bin folder and reinstalled and made these changes…but it still says 20M…what did I do wrong?

Here is my php.ini
http://gametechmods.com/dh-phpini.php

Thanks for the help!


#4

Give it time. Last time I made a change, it took about an hour for PHP to refresh and reload my updated settings.


#5

I read in another topic that I need to run touch dispatch.fcgi

Is that true, and if so how do I do that…the other topic did not give detail.

EDIT:
OK, I figured out how to run touch dispatch.fcgi and that fixed it

THANKS for the help


#6

To touch dispatch.fcgi you can login to ssh and navigate to the directory where your dispatch.fcgi is located and type “touch dispatch.fcgi” without quotes.


#7

In this case, it’s in the cgi-bin directory. Thanks for the tip.


#8

Hi,
I’ve been trying to find the right steps for updating (or customizing) my php.ini file, too. I have the same situation as a few other folks in similar threads: I would like to increase my max_upload_limit and post_max_size directives/vars.

The configuration is as follows:

  1. we’ve got a drupal install (there are some directions on the drupal site, that I’m trying to compare with steps outlined in the forums here) - for example, mkdir cgi-bin in your web/domain top-dir, etc;

  2. I tried the dh-phpini.php route, but I get an error when trying to run it (this may be because of the drupal installation - it will only allow you web-browsable access to the file structure it knows, and files in unexpected formats/naming conventions (like dh-phpini…) throw an error Sorry, I’m fairly new to Drupal, but know php fairly well, so that is a guess… I’m not sure. Shouldn’t I just put a URL like
    http://mysiteDomain/dh-phpini.php into my browser, and then follow from there…? Maybe I’m doing it incorrectly.

  3. I also tried to follow the directions to upgrade from php5.2.15 - which is on our dreamhost server (via “php --version”/“php -v”) - that is, I changed settings from 5.2 fastcgi to 5.3 fastcgi based on the wiki suggestion (http://wiki.dreamhost.com/Installing_PHP5#Using_DreamHost.27s_PHP_5), but I don’t seem to have php5.3 updated (it’s been over 2 hours since I changed the settings…)

Thanks much for any pointers


#9

I solved the problem. I found a minor typo in my .htaccess file that was probably the main culprit (left the “O” off of Options)…
That said, I ended up going the complete route (not only copying the php.ini into my /cgi-bin and changing it, but also copying the php5.cgi to my site cgi-bin, too).
Anyway, just wanted to let you all know, in case anyone was thinking of responding.


#10

great thread. thanks for the help and useful tips


#11

I know this is an old post, but I’m hoping those involved might be able to help me out. My goal was initially the same: to increase my upload limit on a WordPress site, hosted on Dreamhost. I’ve gone through the processes described above as best I can (I know essentially nothing about PHP, SSH, and all of the related stuff). For some reason, my site is still down. I tried the whole “touch dispatch.fcgi” thing via SSH in Terminal (Mac OSX), and it didn’t seem to do anything (I made sure to point to cgi-bin/dispatch.fcgi). My site is giving me an error:

“Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@covenant.aaronjarnold.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.”

I can’t seem to figure out what the problem is. I haven’t done anything with the .htaccess file, mainly because I don’t what it is or where to find it. Sorry to be such a total newbie with this stuff, but I’m doing the best I can and I think I’m just making things worse. I ran the tool at sabrextreme.com and that seems to be what first started causing the errors.

There’s a cgi-bin folder now in the root folder of my site that I don’t believe was there before, and it contains dispatch.cgi, dispatch.fcgi, php.ini and a folder named test, which contains a debug.txt and info.php. If I open up the php.ini, it tells me it’s a custom php.ini that replaces the old one, though I don’t remember there ever actually being one (I looked for it before running that tool and could not find it, guessing it’s hidden by default).

If I rename the cgi-bin folder to something random and reload the site, I still get nothing. I also tried re-running the tool from sabrextreme and it won’t allow me to (it just gives me the same error).

If I FTP into the backend of my site, all of the Wordpress files are still present. I’ve made a local backup of everything there, just in case I need to start from scratch and rebuild, but I’m hoping someone here can help me find a better way.

Thanks in advance,

Aaron


#12

Hi, Aaron.

Did you install your own version of PHP? You no longer need to do that to up your PHP upload size. You can open a ticket with us and we can help you clean that out and get the changes done for you.


#13

Perfect, I will do that on Wednesday when I’m back to work. Thanks!


#14

The autoinstaller doesn’t write that. Something else is stepping in here.

Could you be more verbose on that bit for me please? Maybe copy/pasta the text you are reading.


#15

Here is what the file says. It says that it’s setting “non-standard” settings. After this paragraph, it goes through a list of changes and explains them all.

;;;;;;;;;;;;;;;;;;;
; About this file ;
;;;;;;;;;;;;;;;;;;;
; This is the recommended, PHP 5-style version of the php.ini-dist file. It
; sets some non standard settings, that make PHP more efficient, more secure,
; and encourage cleaner coding.
;
; The price is that with these settings, PHP may be incompatible with some
; applications, and sometimes, more difficult to develop with. Using this
; file is warmly recommended for production sites. As all of the changes from
; the standard settings are thoroughly documented, you can go over each one,
; and decide whether you want to use it or not.
;
; For general information about the php.ini file, please consult the php.ini-dist
; file, included in your PHP distribution.
;
; This file is different from the php.ini-dist file in the fact that it features
; different values for several directives, in order to improve performance, while
; possibly breaking compatibility with the standard out-of-the-box behavior of
; PHP. Please make sure you read what’s different, and modify your scripts
; accordingly, if you decide to use this file instead.


#16

Hi Aaron,

Sorry for the confusion, to clarify, our support staff is unable to help with custom php.ini files and PHP installations. We’ve commented out a few lines of your .htaccess to bring your sites back up in the meantime, though! Please reply to our email if we can help clear up anything on our end.


#17

Okay, so my site is back up. I finally figured out how to access .htaccess (Coda wasn’t showing hidden files… dirp). Dreamhost support commented out everything that was written by the sabrextreme script. If I delete all of their comments, the site continues to work, and if I delete the entire cgi-bin folder, everything continues to work as well. I tried deleting it all and re-running the sabrextreme script, but I came up with the same issues.

I’m not exactly sure which part of the .htaccess changes is causing the issue. The sabrextreme script added three lines of code:

AddHandler fastcgi-script fcg fcgi fpl AddHandler php-fastcgi .php Action php-fastcgi /cgi-bin/dispatch.fcgi

I have no idea what each line does, and if I comment any one of the lines, the site works again. It doesn’t even seem to matter which line or how many lines are commented out, as long as something is commented out… which is odd to me.

So basically, at this point, I’m back to where I’m started. The three lines mentioned above in the .htaccess file are still commented out, so they effectively do nothing. The cgi-bin folder is still intact, but not doing anything. My upload limit is still 7 MB. Anyone? Also, thanks again to all for dealing with my newbieness.
[hr]
Also, I wanted to mention that this is a subdomain, and everything is being installed to the subdomain’s folder. Not sure if that’s important or not, but I figured it’s worth mentioning.


#18

It seems that something changed, somewhere. You can fix it by altering the last line to read: Action php-fastcgi /cgi-bin/dispatch.cgi (not fcgi)

But I must advise against it.

As has been stated by others, we really should be using PHP 5.3 and editing a phprc file to change the environment. Mika indicated here the other day that DH are quite possibly pushing ahead with the implementation of PHP 5.4 regardless of Sushosin support, so Dreamhost version 5.2 (which the autoinstaller uses) could very well disappear on you at any time without notice.

A much better approach:

I’d strongly suggest that you use the Dreamhost default 5.3 FastCGI and create the following file:

/home/username/.php/5.3/phprc

Note the preceding dot (.)php in the path - it is important.

After creating the phprc file just edit in the changes you’d like to make to your PHP environment.


#19

I tried the phprc route, but it didn’t seem to do anything. I created the file you mentioned in the proper folders and put my commands into it, then completed the killall php53.cgi command to reset the script and it did nothing. I waited about 30 minutes to give it some time to reset and still got nothing.

I found another way of doing it online using a user.ini file. I’m not really sure what this file does, but it seems to work (I uploaded a few 20MB files last night and it worked just fine). Here is the code in the user.ini file:

; Limits upload file size to 32 MB upload_max_filesize = 32M post_max_size = 32M


#20

If your phprc is not being read (and you’re certain it’s in the correct location) then you should contact Tech Support as it could indicate an issue with your server’s setup.