|
Here is a tip that I just had occasion to learn. If you are uploading relatively large files you not only have to make sure that in php.ini not only is upload_max_filesize set high enough but also post_max_size. I could not figure out for the life of me why there was no $_POST variable when I clicked submit until I learned of post_max_size's existence.
|
# ¿ Mar 20, 2008 14:46 |
|
|
# ¿ Apr 29, 2024 11:01 |
|
Foolio882 posted:Dear god somebody please help! imagecreatefromjpeg()?
|
# ¿ Mar 25, 2008 19:07 |
|
Here's a time saving tip that can obviously be applied anywhere, but I first started using it with PHP's website. If you use Firefox then navigate over to php.net, right click on the search box and add a keyword of 'php' to the search. Now whenever you need to look up a function hit Ctrl+L (or otherwise get the focus on the address bar), type 'php <<function name>>' and there you are. It also works great if you don't remember the exact name but can come close, which is how I found imagecreatefromjpeg() from createfromjpeg().
|
# ¿ Mar 26, 2008 02:39 |
|
Tap posted:I've recently taken up PHP as my language of choice for learning how to program. It's a kludge of sorts. Until PHP5 there was no way to make a variable or method private, meaning inaccessible to other objects/functions/etc so people would prepend the name with an underscore to tell other people not to use it directly. It won't stop them from doing so, but it suggests the user should do otherwise.
|
# ¿ Mar 27, 2008 18:44 |
|
I was digging through some Kohana code and came across this syntax, which I have never seen before:php:<? ($field === TRUE) and $field = $this->any_field;?> php:<? public function add_rules($field, $rules) { // Handle "any field" filters ($field === TRUE) and $field = $this->any_field; // Get the rules $rules = func_get_args(); $rules = array_slice($rules, 1); ... ?>
|
# ¿ Aug 25, 2009 14:12 |
|
gibbed posted:It's the equivilent of: Standish posted:this is called "short-circuiting". Ah, I see. Thanks for teaching me something new!
|
# ¿ Aug 25, 2009 14:52 |
|
I have a remote MySQL 5.1 server that I am trying to connect to via SSL. From the command line on the web server (FreeBSD 8, Apache 2.2, PHP 5.2.x), I can use the mysql client and connect just fine by specifying the location of ca-cert.pem, but when I try to connect using mysqli the page just hangs. 'Show processlist' on the remote databases's side shows pre:+----+----------------------+--------------------+------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+----------------------+--------------------+------+---------+------+-------+------------------+ | 2 | unauthenticated user | <web ip>:58711 | NULL | Connect | NULL | login | NULL | +----+----------------------+--------------------+------+---------+------+-------+------------------+ php:<?php $conn = mysqli_init(); $conn->ssl_set(NULL, NULL,"/var/www/certs/ca-cert.pem", NULL, NULL); $conn->real_connect($ip, $user, $pwd, $db, 3306, NULL, MYSQLI_CLIENT_SSL); ?> SmirkingJack fucked around with this message at 16:01 on Jan 27, 2010 |
# ¿ Jan 27, 2010 15:53 |
|
|
# ¿ Apr 29, 2024 11:01 |
|
Does anyone happen to know how to keep PHP errors out of Apache's error log? I set error_log to a separate file, which it is logging to, but the errors are also in Apache's and I'd like to keep them out.
|
# ¿ Feb 10, 2010 20:07 |