Debugging PHP… Mettere a punto PHP…
Today I made some changes to Oggi ho apportato alcune modifiche al the blog site (using WordPress 1.5) il blog del sito (utilizzando WordPress 1.5) to make the surrounding content (like most discussed articles, related articles etc.) highly context sensitive. per rendere il contenuto circostante (come la maggior parte discussi articoli, articoli, ecc) altamente sensibili al contesto. Also I made the fonts bigger to improve readability. Ho fatto anche i caratteri più grandi per migliorare la leggibilità.
They weren’t big changes, just added few methods and modified few. Essi non sono stati grandi cambiamenti, a soli pochi metodi aggiunto e modificato alcuni. I tested them on Windows installation of WordPress running on Apache server. Li ho testato su Windows installazione di WordPress in esecuzione sul server Apache. So far so good. Fin qui tutto bene. Worked like a charm. Funzionato come un fascino.
So naturally I just uploaded them to live server running Linux. Così, naturalmente, ho appena caricati a vivere server con Linux. And the site went down. E il sito è andato giù. Now I also had made some changes with the theme (again tested). Ora ho anche avuto apportato alcune modifiche a tema (ancora testato). So it was hard to pinpoint the problem. Così è stato difficile individuare il problema. At one point I removed the plugin directory and the problem persisted. A un certo punto ho cancellato il plugin di directory e il problema persiste. The problem was that the site wasn’t coming up at all. Il problema è stato che il sito non era venuta fino a tutti. Changing the error settings in the configuration file didn’t help. Cambiare le impostazioni di errore nel file di configurazione non ha aiutato.
When renaming the plugin directory failed I assumed data corruption. Quando rinominando il plugin di directory non ho assunto la corruzione dei dati. So I re-installed WordPress from scratch. Così ho re-installare WordPress da zero. Then manually imported the tables, not many, in the new database. Poi importati manualmente le tabelle, non sono molti, nel nuovo database. I disabled the plugins. I disabili i collegamenti. Anyway to cut the long story short I finally nailed it down to the changes I made in the plugin. In ogni modo per tagliare la lunga storia breve ho finalmente inchiodato in giù per le modifiche che ho fatto nel plug-in. After further investigation with a test blog setup I found the culprit. Dopo ulteriori indagini con una prova di impostazione del blog ho trovato il colpevole.
I had the following PHP code, which works fine on my Windows 2000: Ho avuto il seguente codice PHP, che funziona bene per il mio Windows 2000:
$foobah = $wp_query->get_queried_object()->cat_ID foobah $ = $ wp_query-> get_queried_object () -> cat_ID
A variation like $foobah = ($wp_query->get_queried_object())->cat_ID is fine too. Una variante come foobah = $ ($ wp_query-> get_queried_object ())-> cat_ID è troppo bella.
However both crashes and burns on my Linux system. Tuttavia entrambe le ustioni e si blocca sul mio sistema Linux.
The solution was: La soluzione è stata:
$obj = $wp_query->get_queried_object(); obj = $ $ wp_query-> get_queried_object ();
$foobah = $obj->cat_ID; foobah $ = $ obj-> cat_ID;
And now it works on both systems! E ora funziona su entrambi i sistemi!
Am I the only one who thinks this is asinine behavior? Io sono l'unico che ritiene che tale comportamento è asinine?
BTW: In case you are wondering the above code in WordPress will fetch you the category_id when you are in a category ( is_category() ). BTW: Nel caso in cui si chiedono il codice sopra in WordPress si recupererà la category_id quando sei in una categoria (is_category ()). Unfortunately I couldn’t find any documented functionality to provide me with this information. Purtroppo non sono riuscito a trovare qualsiasi documentato per fornire funzionalità di me con queste informazioni.
The documented functions in WordPress are more geared towards UI. Documentate in WordPress funzioni sono più orientate verso l'interfaccia utente. Many of them actually output the generated string, making them harder to maniulate. Molti di loro effettivamente uscita la stringa generata, rendendoli più difficili da maniulate.
In the process I removed Google Ad from the left navigation bar (except from front page) hopefully making the site faster. Nel processo ho cancellato degli annunci di Google dalla barra di navigazione a sinistra (tranne da prima pagina) si spera che il sito più veloce. Also I found a documented (and legal) way to prevent Google Ad from occupying the space when it doesn’t have any relevant advertisement. Inoltre ho trovato un documentato (e legale) modo di impedire a Google di annunci di occupare lo spazio quando essa non ha alcun annuncio pertinente. From now Google Ad Space will be filled with content whenever ads are not available. Da ora degli annunci di Google Space sarà riempita di contenuti ogni volta che gli annunci non sono disponibili.
I also drastically reduced the number of plugins I use in this site. Ho anche ridotto drasticamente il numero di collegamenti utilizzare in questo sito. The only external plugins at this point is WP-HashCash (Additionally I use the I collegamenti esterni solo a questo punto è WP-Hashcash (inoltre utilizzare il Referrer Bouncer Referrer Bouncer and e No Follow No follow plugins developed internally). plugin sviluppato internamente). It seems to be having some problems with recent wave of spammers. Sembra avere alcuni problemi con la recente ondata di spammer.
Filed under Elencato sotto CMS Software CMS Software , Google , PHP , Pro Blogging Pro Blogging , Technology Tecnologia , WordPress | |
| |
RSS 2.0 RSS 2,0 | |
Email this Article Invia questo articolo
You may also like to read Si può anche leggere come |





May 22nd, 2005 at 8:36 pm 22 maggio 2005 a 8:36 pm
Are you saying that hascash failed against a spam attack? Sta dicendo che non hascash nei confronti di un attacco di spam? uh oh.. uh oh ..
May 22nd, 2005 at 9:50 pm 22 maggio 2005 a 9:50 pm
3-4 spams crept in. It could be that they were manually entered, in which case HashCash doesn’t help much. 3-4 Spam insinuato pollici È possibile che essi sono stati immesso manualmente, nel qual caso Hashcash non aiuta molto.
I was in a hurry so I just deleted them. Ero in una fretta così ho appena soppressi. Next time, if it recurs, I will analyze. La prossima volta, se lo si ripete, vorrei analizzare.
May 22nd, 2005 at 10:34 pm 22 maggio 2005 a 10:34 pm
by the way what country are you from? a proposito ciò che paese sei? I am guessing you are in Germany but I could be wrong.. Io sono indovinando siete in Germania ma potrebbe essere sbagliato ..
Tom
May 23rd, 2005 at 10:12 am 23 maggio 2005 alle 10:12 am
> by the way what country are you from? > A proposito ciò che paese sei?
India - India -- http://blog.taragana.com/index.php/about-me/
I am curious to know why you guessed Germany Sono curioso di sapere perché avete indovinato Germania