This is a discussion on Disabled mail function workaround? within the PHP Language forums, part of the PHP Programming Forums category; Hi! I have been asked to add some functionality to an existing web site. The user would like to have ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi! I have been asked to add some functionality to an existing web
site. The user would like to have a form that would email them the results of the form. Really easy stuff to do, usually. I tried to run the enhancements, and did not get the results I wanted, either with writing the results to a log file on the server, nor in sending the email. In doing further research, I see that the site is being hosted on a windows server, and that the php appears to have a bunch of functions disabled, when I run phpinfo. One of the many that are disabled is mail, so I'm kind of stuck. Is there any sort of workaround to this, where the mail function is disabled, but I'd still be able to send email from a form? For reference, here are the functions that are disabled: getmyinode, getopt, getrusage, extension_loaded, dl, mysql_pconnect, crack_check, crack_closedict, crack_getlastmessage, crack_opendict, fsockopen, pfsockopen, mysql_list_dbs, mysql_stat, ini_get, ini_get_all, ini_alter, ini_set, get_current_user, get_defined_constants, get_include_path, php_ini_scanned_files, php_uname, phpcredits, restore_include_path, set_include_path, set_time_limit, version_compare, zend_version, getmypid, getmyuid, getmygid, assert_options, assert, fopen, fwrite, fread, file, fpassthru, file, mail, opendir, readdir, closedir Thanks! Scott |
|
|||
|
sae@worf.netins.net (Scott Evans) wrote:
> In doing further research, I see that the site is being hosted on a > windows server, and that the php appears to have a bunch of functions > disabled, when I run phpinfo. One of the many that are disabled is > mail, so I'm kind of stuck. Is there any sort of workaround to this, > where the mail function is disabled, but I'd still be able to send > email from a form? > > For reference, here are the functions that are disabled: > > getmyinode, getopt, getrusage, extension_loaded, dl, mysql_pconnect, > crack_check, crack_closedict, crack_getlastmessage, crack_opendict, > fsockopen, pfsockopen, mysql_list_dbs, mysql_stat, ini_get, ini_get_all, > ini_alter, ini_set, get_current_user, get_defined_constants, > get_include_path, php_ini_scanned_files, php_uname, phpcredits, > restore_include_path, set_include_path, set_time_limit, version_compare, > zend_version, getmypid, getmyuid, getmygid, assert_options, assert, fopen, > fwrite, fread, file, fpassthru, file, mail, opendir, readdir, closedir Can you use system() to run blat.exe (google for it)? Also, odd (but irrelevant) that you can't fread() but you can file_get_contents(). miguel -- Photos from 40 countries on 5 continents: http://travel.u.nu Latest photos: Malaysia; Thailand; Singapore; Spain; Morocco Airports of the world: http://airport.u.nu |
|
|||
|
> getmyinode, getopt, getrusage, extension_loaded, dl, mysql_pconnect, > crack_check, crack_closedict, crack_getlastmessage, crack_opendict, > fsockopen, pfsockopen, mysql_list_dbs, mysql_stat, ini_get, ini_get_all, > ini_alter, ini_set, get_current_user, get_defined_constants, > get_include_path, php_ini_scanned_files, php_uname, phpcredits, > restore_include_path, set_include_path, set_time_limit, version_compare, > zend_version, getmypid, getmyuid, getmygid, assert_options, assert, fopen, > fwrite, fread, file, fpassthru, file, mail, opendir, readdir, closedir I really can't see any reason why these are setup like this. ini_get is disabled? That pretty much means that any advanced service will fail when it checks system requirements. phpcredits? Surely that's harmless. Assert? That's useful for debugging. My gut feeling says that either: a) the host is trying to be secure, but is just limiting functionality, or b) the host hasn't setup the server correctly, so they are trying to avoid these problems. For example, fread could be disabled to avoid reading files from other accounts. Any properly setup host would have their permissions configured correctly. Have you tried contacting them? fwrite and fread are critical for ANY application and is going to indicate high loads -- caching becomes near impossible. Probably not what you want to hear: If they don't want to enable these, get out. It probably indicates that they don't know what they're doing. All the best, Carl |
|
|||
|
On Tue, 8 Aug 2006 15:27:30 +0000 (UTC), sae@worf.netins.net (Scott Evans)
wrote: >Hi! I have been asked to add some functionality to an existing web >site. The user would like to have a form that would email them the >results of the form. Really easy stuff to do, usually. I tried to >run the enhancements, and did not get the results I wanted, either >with writing the results to a log file on the server, nor in sending >the email. > >In doing further research, I see that the site is being hosted on a >windows server, and that the php appears to have a bunch of functions >disabled, when I run phpinfo. One of the many that are disabled is >mail, so I'm kind of stuck. Is there any sort of workaround to this, >where the mail function is disabled, but I'd still be able to send >email from a form? Well, the proper answer is to ask the admin to re-enable mail, or switch hosts. If they've disabled the mail functions, and you do some hacky workaround to send mail anyway without asking the admins, it wouldn't be that surprising if the admin of the server got somewhat annoyed... >getmyinode, getopt, getrusage, extension_loaded, dl, mysql_pconnect, >crack_check, crack_closedict, crack_getlastmessage, crack_opendict, >fsockopen, pfsockopen, mysql_list_dbs, mysql_stat, ini_get, ini_get_all, >ini_alter, ini_set, get_current_user, get_defined_constants, >get_include_path, php_ini_scanned_files, php_uname, phpcredits, >restore_include_path, set_include_path, set_time_limit, version_compare, >zend_version, getmypid, getmyuid, getmygid, assert_options, assert, fopen, >fwrite, fread, file, fpassthru, file, mail, opendir, readdir, closedir If they're locking down things as basic as fopen then you'll have difficulty communicating with the outside world in any way; you're not likely to be able to open any sockets to even do SMTP mailing yourself. -- Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool |