Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-29-2005, 06:23 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default chmod() question

What would have to be done to allow chmod() to work prop?
My host took off open_basedir restrictions for my user, but it still would not work...
Im writing a script to run on this host and this host alone, so it would be good if the files could be made writable and back again on demand.
Host is running php4/a linux distro/apache1.3

TIA


//peace
Reply With Quote
  #2  
Old 01-29-2005, 07:36 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Revan
What would have to be done to allow chmod() to work prop?
My host took off open_basedir restrictions for my user, but it still would not work...
Im writing a script to run on this host and this host alone, so it would be good if the files could be made writable and back again on demand.
Host is running php4/a linux distro/apache1.3

TIA


//peace
where are you trying chmod to, and what are you putting in the function?
Reply With Quote
  #3  
Old 01-29-2005, 08:13 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<?php
if (!is_writable('test.txt'))
{
    if (!
chmod('test.txt'0777))
    {
        echo 
"owned";
    }
    else
    {
        echo 
"yay";
    }
}
?>
Getting "operation not permitted" error.
And yes, the text file does exist and it is currently chmod()'ed to 644 (default).
Reply With Quote
  #4  
Old 01-29-2005, 11:36 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

did you tried also with full patch of file ?

like

PHP Code:
$mydir getcwd();
chmod($mydir."/test.txt"0777
Reply With Quote
  #5  
Old 01-29-2005, 11:41 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yup, now that is tried too.
Warning: chmod(): Operation not permitted in /public_html/test.php on line 5
Bastard php
Reply With Quote
  #6  
Old 01-29-2005, 11:46 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

heh,
well maybe the host dosent allow chmod change at all

can you change chmod via ftp or ssh cilent ?
Reply With Quote
  #7  
Old 01-30-2005, 09:12 AM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes I can, that's not the problem. I want the script to be able to change chmod on command, since it will be writing to a config file which only needs to be writable while writing.
Host tried to enable chmod in php, but didn't know how to do it.
I also looked through php.ini and theres nothing about "chmod" in there...
Reply With Quote
  #8  
Old 01-30-2005, 12:33 PM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sometimes the public_html folder is an alias of a www folder (ASO does this). IF this is the case.. change your path to /www/test.php to use the actual file directory and not an alias directory.
Reply With Quote
  #9  
Old 01-30-2005, 12:37 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can you give more info about your host ?
like php version and Os

also please check if php is under safe_mode
cuse some function dosent work with safe mode
to check use this script

PHP Code:
<?php 
// Check for safe mode
if( ini_get('safe_mode') ){
   echo 
"Safe mode is on";
}else{
  echo 
"Safe mode is off";
}

?>
if safe mode is on turn it off and try again
and please report.

edit :

YEP i was right chmod is disabled on safe mode

you can find all of functions that dosent work with safe mode
here

lets hope this is the problem.
Reply With Quote
  #10  
Old 01-30-2005, 06:11 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by miz
can you give more info about your host ?
like php version and Os
Quote:
Originally Posted by Revan
Host is running php4/a linux distro/apache1.3
And no, safe mode is off... :ermm:
Thanks for the effort
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:59 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04292 seconds
  • Memory Usage 2,260KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete