Koozali.org: home of the SME Server

php.ini

Offline davelister

  • *
  • 51
  • +0/-0
    • IgnitionJournal
php.ini
« on: April 08, 2010, 06:56:15 AM »
G'day

Once again I come humbling looking for advise and help :-)

I suspect I have stuffed my php.ini all of my wordpress sites are now unable to upload automatically to wp-content/uploads folder. I can upload via ftp with no problems, and I have checked all of my permissions on the directories needed.

I have checked out my php configuration and noticed the 'upload_tmp_dir' is set at 'no value'. Could someone please confirm that 'no value' is the default setting within php configuration?

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: php.ini
« Reply #1 on: April 08, 2010, 01:41:55 PM »
I suspect I have stuffed my php.ini all of my wordpress sites are now unable to upload automatically to wp-content/uploads folder. I can upload via ftp with no problems, and I have checked all of my permissions on the directories needed.
AFAIK this is default behavior and you did not stuff anything.

I have checked out my php configuration and noticed the 'upload_tmp_dir' is set at 'no value'. Could someone please confirm that 'no value' is the default setting within php configuration?
AFAIK that is default. But to be sure you can check that you do not have the following folders:
/etc/e-smith/templates-custom/etc/php/
/etc/e-smith/templates-user/etc/php/
/etc/e-smith/templates-user-custom/etc/php/
If they do not exist you do not have custom template fragments and all is done using the normal template fragments and the internal configuration database.

All internal configuration settings can be reviewed with the following command:
Code: [Select]
db configuration show php
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline davelister

  • *
  • 51
  • +0/-0
    • IgnitionJournal
Re: php.ini
« Reply #2 on: April 08, 2010, 02:04:03 PM »
thanks very much for the help cactus... I nearly went blind re reading the manual :-P

I fixed the problem by the following and would love to know if there are any mistakes I should be aware of:

db accounts setprop IBAYNAMEHERE PHPBaseDir /home/e-smith/files/ibays/IBAYNAMEHERE/:/tmp

signal-event ibay-modify IBAYNAMEHERE

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: php.ini
« Reply #3 on: April 08, 2010, 02:47:17 PM »
I am not sure that uploading to /tmp really is what you desire. It might be a security issue IIRC.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: php.ini
« Reply #4 on: April 08, 2010, 07:19:29 PM »
I am not sure that uploading to /tmp really is what you desire. It might be a security issue IIRC.

Cactus, a lot of php aplications need to store temporary files under the defined directory in php.ini wich is /tmp. See session.save_path in php.ini.

So, OpenBaseDir configuration including /tmp is correct.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: php.ini
« Reply #5 on: April 08, 2010, 10:32:14 PM »
Cactus, a lot of php aplications need to store temporary files under the defined directory in php.ini wich is /tmp. See session.save_path in php.ini.
If almost everyone does it, it does not make it safe. I see lots of people crossing busy streets when the red light is on... but that does not make it safe does it?

So, OpenBaseDir configuration including /tmp is correct.
I never said it was incorrect... I said it might be a security issue.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline davelister

  • *
  • 51
  • +0/-0
    • IgnitionJournal
Re: php.ini
« Reply #6 on: April 08, 2010, 10:46:59 PM »
thanks for the input everyone.

Cactus I value your input regarding security, is there another option I can follow? At the moment our company website uses a wordpress theme which requires the upload in order to rotate the 'feature image', the company also runs a contact database which requires the upload feature for photos to make student id cards and library cards. If there is another way I would love to give it a go.

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: php.ini
« Reply #7 on: April 09, 2010, 12:56:29 AM »
davelister

IIRC you create a tmp folder under the ibay html folder ie
.../ibayname/html/tmp/
and then specify that location using the db command mentioned.
That way different apps use different tmp folders and hackers cannot gain access via unintended web access granted to other files in /tmp, which may be associated with buggy apps or apps with security vulnerabilities.

Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline davelister

  • *
  • 51
  • +0/-0
    • IgnitionJournal
Re: php.ini
« Reply #8 on: April 09, 2010, 01:11:10 AM »
I think I understand it now: I can create a tmp folder in the ibay and give permission using the db command just to that tmp directory in the ibay and then associate that app with the tmp folder created.

mmm seeing how I am the only guy here with the slightest chance of looking after IT, and I am only part time... security is the number one importance for the people here. So I might have to come up with an alternative plan for the wordpress 'featured image' and the upload images for the ID cards.

Thanks for input people. If anyone else has some suggestions I would be keen to hear form you

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: php.ini
« Reply #9 on: April 09, 2010, 01:18:09 AM »
I can't found a solution to this issue. I have disable /tmp in allowed paths, and now I can't upload images to WP. Also I read WP forums and added a new WP variable named WP_TEMP_DIR to the folder I have created at ibay/html/tmp, but not work.

Also horde use the /tmp folder. Look at horde config.php file
« Last Edit: April 09, 2010, 01:20:02 AM by Normando »