ini-set

How do I check if ini_set() is enabled either in the global PHP.INI or in my PHP script?

百般思念 提交于 2019-12-05 11:57:35
I have an app that is failing on the install. The vendor says I probably have ini_set() disabled. How can I check this? I did some research on this, and it turns out that sometimes ini_set will not return FALSE, but an empty string. This is mentioned in the URL pointed out by gabriel1836. The best way to check if it works is to first check the disable_functions flag in php.ini to see if it is disabled, and then (if it is not disabled), change a value with it, and echo phpinfo() immediately after. If the value is changed under the local column, then you know ini_set works. You might want to

PHP: mail() function with runtime ini_set() for SMTP and SMTP_PORT not working on Linux

拈花ヽ惹草 提交于 2019-12-04 13:07:27
I have used a PHP code for Mailing using a SMTP HOST as given below: ini_set('SMTP','myserver'); ini_set('smtp_port',25); $to = $email; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n"; $headers .= "From: NO-REPLY<no-reply@mydomain.com>" . "\r\n"; $subject = "Confirmation For Request"; $message = '<html> <body> <p>Hi '.$firstname.' '.$lastname.'</p> <p> We recieved below details from you. Please use given Request/Ticket ID for future follow up: </p> <p> Your Request/Ticket ID: <b>'.$ticketID.'</b> </p> <p> Thanks,<br> '.$team.' Team. <

How to override register_argc_argv in PHP?

笑着哭i 提交于 2019-12-01 17:26:43
I'm using a shared host (fasthostingdirect) and for some reason they have this flag turned off by default. This means I'm unable to access PHP command line parameters... unless I use the -n (= --no-php-info ) flag after php.exe . Have tried ini_set('register_argc_argv', 1) in my php file but it has no effect. Am guessing this is due to the clamped down nature of the hosting provider, however they don't stop the -n option - not sure of the other implications of using this though. Does anyone have any better suggestions? The ini_set('register_argc_argv', 1) does not work because by the time the

What are the reasons why PHP would echo errors, even with error_reporting(0)?

て烟熏妆下的殇ゞ 提交于 2019-11-30 12:11:57
What are some reasons why PHP would force errors to show, no matter what you tell it to disable? I have tried error_reporting(0); ini_set('display_errors', 0); with no luck. Note the caveat in the manual at http://uk.php.net/error_reporting : Most of E_STRICT errors are evaluated at the compile time thus such errors are not reported in the file where error_reporting is enhanced to include E_STRICT errors (and vice versa). If your underlying system is configured to report E_STRICT errors, these may be output before your code is even considered. Don't forget, error_reporting/ini_set are runtime

What are the reasons why PHP would echo errors, even with error_reporting(0)?

 ̄綄美尐妖づ 提交于 2019-11-29 17:57:20
问题 What are some reasons why PHP would force errors to show, no matter what you tell it to disable? I have tried error_reporting(0); ini_set('display_errors', 0); with no luck. 回答1: Note the caveat in the manual at http://uk.php.net/error_reporting: Most of E_STRICT errors are evaluated at the compile time thus such errors are not reported in the file where error_reporting is enhanced to include E_STRICT errors (and vice versa). If your underlying system is configured to report E_STRICT errors,

PHP Multi-Domain Sessions; ini_set Not Working?

拥有回忆 提交于 2019-11-29 12:56:59
I'm trying to set it up so if you log in to my website the session carries over to all sub-domains of my website. For example, if you go to domain.com and log in, then go to sub.domain.com, you'll already be logged in at sub.domain.com. To my understanding, you would want to use ini_set('session.cookie_domain','.domain.com') and then session_start(), then set your session variables, but this isn't working. Example of what I'm doing: Code for domain.com: <?php ini_set('session.cookie_domain','.domain.com'); session_start(); $_SESSION['variable'] = 1; ?> Code for sub.domain.com: <?php session

PHP Multi-Domain Sessions; ini_set Not Working?

亡梦爱人 提交于 2019-11-28 06:16:24
问题 I'm trying to set it up so if you log in to my website the session carries over to all sub-domains of my website. For example, if you go to domain.com and log in, then go to sub.domain.com, you'll already be logged in at sub.domain.com. To my understanding, you would want to use ini_set('session.cookie_domain','.domain.com') and then session_start(), then set your session variables, but this isn't working. Example of what I'm doing: Code for domain.com: <?php ini_set('session.cookie_domain','

passing session id via url

牧云@^-^@ 提交于 2019-11-28 01:24:26
I'm trying to get my script to use url session id instead of cookies. The following page is not picking up the variable in the url as the session id. I must be missing something. First page http://www.website.com/start.php ini_set("session.use_cookies",0); ini_set("session.use_trans_sid",1); session_start(); $session_id = session_id(); header("location: target.php?session_id=". $session_id ); Following page - http://www.website.com/target.php?session_id=rj3ids98dhpa0mcf3jc89mq1t0 ini_set("session.use_cookies",0); ini_set("session.use_trans_sid",1); print_r($_SESSION); print(session_id())

passing session id via url

房东的猫 提交于 2019-11-26 17:20:55
问题 I'm trying to get my script to use url session id instead of cookies. The following page is not picking up the variable in the url as the session id. I must be missing something. First page http://www.website.com/start.php ini_set("session.use_cookies",0); ini_set("session.use_trans_sid",1); session_start(); $session_id = session_id(); header("location: target.php?session_id=". $session_id ); Following page - http://www.website.com/target.php?session_id=rj3ids98dhpa0mcf3jc89mq1t0 ini_set(