Help with PHP.INI

Questions regaring MySQL and PHP may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.

how to edit the php.ini file in telnet?

Postby bensir » Sun Mar 18, 2007 5:33 pm

can someone tell me what is the command to edit the php.ini?

I have get access into the php.in, by root user login.
I did try the command of "type" and "read" from the help, but still cannot eidt it. my version of NAS is DS-106e

I just too new in telnet ><;
I don't have a idea how the telnet command work, can someone help?

Ben
bensir
I'm New!
I'm New!
 
Posts: 2
Joined: Sun Mar 18, 2007 5:24 pm

Postby HarryPotter » Sun Mar 18, 2007 6:20 pm

You dont edit it with telnet (ok its possible, but not so confortable).

So first copy the file to a shared folder using telnet:

Code: Select all
cp /usr/syno/etc/php.ini /volume1/public


Then edit it with normal an editor of your choice

finaly copy the file back using telnet command:

Code: Select all
cp /volume1/public/php.ini /usr/syno/etc/php.ini


Changes are not taken until you restart apache: deactivate webservice, and reactivate it (or reboot DS)
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS712+ / DSM 4.2 3211 / 2 x HD204UI (RAID0) / LMS 7.7.2-007
DS110+ / DSM 4.2 3211 / HD154UI
DS408 / DSM 4.0 2228 / 3 x ST31000340AS (RAID0) + 1 x HDS721010KLA330
DS207+ / DSM 3.1.1636 / ST31000340AS + WD5000KS
DS-106x / DSM 4.0 2228 (from DS108j) /

2 Squeezebox 3 + Boom
Rapsody N35

APC Smart UPS SUA750i
User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
 
Posts: 12330
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

thx it work!

Postby bensir » Mon Mar 19, 2007 3:17 pm

thanks to HarryPotter it work for me! Cool

I have another question.
I would find the my.ini to further edit too, but cannot find it by "find -name my.ini"

how could I go the my.ini for edit? please anyone have idea?
bensir
I'm New!
I'm New!
 
Posts: 2
Joined: Sun Mar 18, 2007 5:24 pm

Postby nwsco » Thu Apr 19, 2007 9:28 am

HarryPotter wrote:You dont edit it with telnet (ok its possible, but not so confortable).

So first copy the file to a shared folder using telnet:

Code: Select all
cp /usr/syno/etc/php.ini /volume1/public


Then edit it with normal an editor of your choice

finaly copy the file back using telnet command:

Code: Select all
cp /volume1/public/php.ini /usr/syno/etc/php.ini


Changes are not taken until you restart apache: deactivate webservice, and reactivate it (or reboot DS)


Thx m8! you're a lifesaver!
Just one thing: when copying back, i get:
cp: unable to open '/usr/syno/etc/php.ini': permission denied

What to do?

Thanks again!
nwsco
Trainee
Trainee
 
Posts: 19
Joined: Sat Apr 14, 2007 5:54 pm

Postby HarryPotter » Thu Apr 19, 2007 9:45 am

The only reason I can imagine is that you didnt telnet in with user "root" (password is the same as you use for "admin")
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS712+ / DSM 4.2 3211 / 2 x HD204UI (RAID0) / LMS 7.7.2-007
DS110+ / DSM 4.2 3211 / HD154UI
DS408 / DSM 4.0 2228 / 3 x ST31000340AS (RAID0) + 1 x HDS721010KLA330
DS207+ / DSM 3.1.1636 / ST31000340AS + WD5000KS
DS-106x / DSM 4.0 2228 (from DS108j) /

2 Squeezebox 3 + Boom
Rapsody N35

APC Smart UPS SUA750i
User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
 
Posts: 12330
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

Postby nwsco » Thu Apr 19, 2007 9:52 am

Thanks again Harry! Thats it! Wow.....you're good :o)))
nwsco
Trainee
Trainee
 
Posts: 19
Joined: Sat Apr 14, 2007 5:54 pm

Re: Help with PHP.INI

Postby XIONG » Sun Jun 01, 2008 4:14 pm

Cool, thanks for the heads up!
XIONG
 

Re: Help with PHP.INI

Postby julle » Fri Jun 27, 2008 7:30 am

i don´t get this !!

i can´t finde the php.ini file ( i am usen windows ) can som one help me plz :oops:
julle
I'm New!
I'm New!
 
Posts: 2
Joined: Wed Apr 09, 2008 7:57 am
Location: Denmark

Re: Help with PHP.INI

Postby wmike1503 » Sat Nov 01, 2008 12:55 pm

Hi,

Struggling with this.

Telnet using root + password.

Unable to access files at all - dir shows 3 root directories - unable to access any of them.

Is there some sort of guide available - now idea here whatsoever. Using a DS107+.

just looking to get full control over PHP & mySql.

Any advice greatly appreciated.

Cheers!

Mike
wmike1503
Beginner
Beginner
 
Posts: 28
Joined: Thu Oct 30, 2008 10:52 am

Re: Help with PHP.INI

Postby HarryPotter » Sat Nov 01, 2008 1:36 pm

Wiki Modifications (especially point 4.1 - 4.4)

Your are on the right way - "cd /volume1" and then "dir" is the way to see your shares.
*Please do not Private Message me for support questions; leave it on the forum so all members can learn. Thanks!*

DS712+ / DSM 4.2 3211 / 2 x HD204UI (RAID0) / LMS 7.7.2-007
DS110+ / DSM 4.2 3211 / HD154UI
DS408 / DSM 4.0 2228 / 3 x ST31000340AS (RAID0) + 1 x HDS721010KLA330
DS207+ / DSM 3.1.1636 / ST31000340AS + WD5000KS
DS-106x / DSM 4.0 2228 (from DS108j) /

2 Squeezebox 3 + Boom
Rapsody N35

APC Smart UPS SUA750i
User avatar
HarryPotter
Honorary Moderator
Honorary Moderator
 
Posts: 12330
Joined: Mon Oct 23, 2006 12:48 pm
Location: Switzerland

Re: Help with PHP.INI

Postby Queadha » Sun Oct 09, 2011 12:18 am

Hi,
here we are in 2011 (latest post here is from 2008) and I'm also having issues with the safe_mode (bummer).

1.What I gathered is that safe-mode disables the execution of sensitive command that could be called along exposed path(malicious queries) like in /volume1/web/myblog.com/comment

2.I gathered php.ini is the place where you can add/remove exceptions so that you can run your commands wherever you want anyway, still keeping the safe_mode anywhere else.

Using DSM 3.2, isn't this feature (adding exception paths) included in:
Control Panel > Web Services > Customize PHP open_basedir (where I just would have to drop the desired path)
or is this option modifying something else?

Let's say I'm rather unsure

Front end I'm trouble shooting:
Code: Select all
Warning: is_readable(): open_basedir restriction in effect. File(/usr/syno/php/lib/php/MDB2/Driver/mysqli.php) is not within the allowed path(s): (/etc.defaults:/usr/bin/php:/usr/syno/synoman:/etc:/var/run:/tmp:/var/spool/php:/volume1/@tmp/php:/var/services/web:/var/services/photo:/var/services/blog:/var/services/homes:/volume1/web/myblog.com/openflyers/pear) in /volume1/web/myblog.com/openflyers/MDB2.php on line 963

Where in line 963, the php file says:
Code: Select all
if (is_readable($dir . DIRECTORY_SEPARATOR . $file)) {return true;}

although I know for a fact is_readable does NOT work with safe_mode.

Any knowledge sharing would be fine at this point :wink:
Queadha
I'm New!
I'm New!
 
Posts: 1
Joined: Sat Oct 08, 2011 11:52 pm

Previous

Return to MySQL/PHP Mods

Who is online

Users browsing this forum: No registered users and 0 guests