Editing
Troubleshooting of PHP errors
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
PHP 技術問題的排除與解決 This article categorizes various PHP issues into four main types: # '''File and Directory Issues''': These involve problems related to file handling and directory operations in PHP, such as file not found errors or issues with file permissions. # '''Configuration and Environment Issues''': This category covers issues arising from misconfigurations or environmental factors, including PHP settings, memory limits, and server configurations. # '''Error Handling and Debugging''': These issues pertain to errors and debugging challenges, such as syntax errors, runtime errors, and debugging messages. # '''General PHP Practices''': This encompasses best practices and general usage of PHP, including coding standards, command-line usage, and avoiding common pitfalls. == Troubleshooting steps of PHP errors == Display error message or check the PHP error logs * {{kbd | key=<nowiki>ini_set("display_errors", "On");</nowiki>}} See details on [http://php.net/manual/en/errorfunc.configuration.php PHP: Runtime Configuration - Manual] * {{kbd | key=<nowiki>error_reporting(E_ALL);</nowiki>}} See details on [http://php.net/manual/en/function.error-reporting.php PHP: error_reporting - Manual] * [https://www.jetbrains.com/help/phpstorm/event-log-tool-window.html Event Log - Help | PhpStorm] Check the Web service logs # {{kbd | key=<nowiki>sudo tail /var/log/httpd/error.log</nowiki>}} if the web service logs was located at {{kbd | key=<nowiki>/var/log/httpd/error.log</nowiki>}} # Example log: {{kbd | key=<nowiki>[Thu Nov 08 12:20:40.412630 2018] [:error] [pid 12769] [client x.x.x.x:4433] PHP Parse error: syntax error, unexpected '$var' (T_VARIABLE) in /home/wwwroot/path/to/file.php on line 100</nowiki>}} # Display partial source code: {{kbd | key=<nowiki>sed -n '990,110p;111q' /home/wwwroot/path/to/file.php</nowiki>}}<ref>[https://stackoverflow.com/questions/83329/how-can-i-extract-a-predetermined-range-of-lines-from-a-text-file-on-unix How can I extract a predetermined range of lines from a text file on Unix? - Stack Overflow]</ref> # 檢查網站伺服器 error log e.g. 如果使用 [https://www.nginx.com/ NGINX] Web Server 可輸入指令 {{kbd | key=<nowiki>sudo tail /var/log/nginx/error.log</nowiki>}} Simply the question * Is the [http://php.net/manual/en/function.function-exists.php function_exists]? ** Extension dependency? Install the extension you need. ** If not, looking for the alternative functions. * Was the function really executed? Maybe using the __LINE__ to examin the logic. * Disable the logical judgement and just print text using [http://php.net/manual/en/function.var-dump.php var_dump] or [http://php.net/manual/en/function.print-r.php print_r] functions. * Check the if-else condition was satisfied or not cf: [http://www.leepoint.net/notes-java/data/strings/12stringcomparison.html Java: String Comparison] It's logical (compiler will not show the warning) but wrong. * try & catch: [http://php.net/manual/en/language.exceptions.php PHP: Exceptions] === logging === native error logging * [http://www.php.net/ PHP] log: check the configuration file: /etc/php.ini (the location of configuration file can be verified by [http://php.net/manual/en/function.phpinfo.php phpinfo()] ) (for production site) unmark theese lines in the php.ini and restart Apache service <pre> log_errors = On error_log = "php_error.log" </pre> (for development site) using [http://php.net/manual/en/function.error-reporting.php error_reporting] <pre> error_reporting(E_ALL); </pre> [http://tw1.php.net/print_r PHP: print_r - Manual] <pre> $log = print_r($variable, true); //save to the log file $log = print_r(debug_backtrace(), true); //Generates a backtrace and save to the log file </pre> capture the result of var_dump: ob_start * [http://stackoverflow.com/questions/139474/how-can-i-capture-the-result-of-var-dump-to-a-string php - How can I capture the result of var_dump to a string? - Stack Overflow] * [http://php.net/manual/en/function.error-log.php PHP: error_log - Manual] <pre> ob_start(); var_dump($some_variable); $result = ob_get_clean(); error_log($result, 3, 'd:/result.log'); </pre> QuickForm <pre> $result = var_dump($some_variable); $form->addElement('html', $result); </pre> [http://ellislab.com/codeigniter CodeIgniter]: [http://stackoverflow.com/questions/7370391/how-to-configure-codeigniter-to-report-all-errors php - How to configure Codeigniter to report all errors? - Stack Overflow] show the line number and filename <pre> echo 'Houston, we've had a problem '. __line__ . ' ' . __FILE__ ."<br />"; </pre> more on [http://php.net/manual/en/language.constants.predefined.php PHP: Magic constants], [https://github.com/Seldaek/monolog monolog] == File and Directory Issues == === 檔案操作有關 === 可否讀取或寫入:例如 imagejpeg($canvas, $filename, 100); 沒有顯示錯誤訊息,則需要 * 檢查檔案或目錄是否存在 [http://tw2.php.net/file_exists file_exists] * 檢查檔案是否可以讀取 [http://php.net/manual/en/function.is-readable.php is_readable] * 如果是上傳檔案,需要檢查暫存目錄是否可以寫入 [http://stackoverflow.com/questions/1520956/php-way-to-find-the-web-servers-temp-path upload - PHP way to find the web server's temp path? - Stack Overflow] * 檢查該檔案所在目錄是否已經建立,若未建立則需要建立 [http://php.net/manual/en/function.mkdir.php mkdir],並設定可以寫入。如果產生位置是在多層子目錄下 (巢狀的多層目錄),則需要啟用 recursive 選項<ref>[http://stackoverflow.com/questions/2303372/create-a-folder-if-it-doesnt-already-exist php - Create a folder if it doesn't already exist - Stack Overflow] code snippet: <nowiki>mkdir('path/to/directory', 0755, true);</nowiki> </ref> * 設定該檔案/目錄是否可以寫入: 如果要刪除或寫入檔案,需要檢查是否具備寫入權限 *# SELinux (Security-Enhanced Linux) policy: {{kbd | key = httpd_sys_rw_content_t}}<ref>[https://blog.lysender.com/2015/07/centos-7-selinux-php-apache-cannot-writeaccess-file-no-matter-what/ CentOS 7 + SELinux + PHP + Apache – cannot write/access file no matter what | Lysender's Daily Log Book]</ref> *# (optional) 該檔案/目錄的 (1) 擁有者是網站使用者 (e.g. 網站伺服器設定檔預設值 CentOS 的 Apache 伺服器是 apache、Ubuntu 的 Apache 伺服器則是 www-data<ref>[https://ubuntuforums.org/showthread.php?t=1293508 [SOLVED] How to find out Apache Username?]</ref>) 、或者是 (2) 網站使用者的群組 (e.g. CentOS 的 Apache 伺服器是 apache、Nginx 伺服器是 nginx) 可以寫入 *# {{Win}} [http://www.webdeveloper.com/forum/showthread.php?165933-File-Permissions-in-Windows-(WAMP) File Permissions in Windows (WAMP)] <ref>[https://technet.microsoft.com/en-us/library/Cc754344.aspx Set, View, Change, or Remove Permissions on Files and Folders]</ref> * 驗證是否具備寫入權限: *# 輸入 {{Linux}} 指令 (1) 檢查檔案權限 {{kbd | key = ls -Z /path/to/file}}、(2) 檢查目錄權限 {{kbd | key = ls -Zd /path/to/directory/}} *# PHP [https://www.php.net/manual/en/function.get-current-user.php get_current_user] function *# PHP [http://php.net/manual/en/function.is-writable.php is_writable function] === 錯誤訊息: no such file or directory 找不到 PHP 路徑 === <pre> % php -v zsh: no such file or directory: /Applications/MAMP/bin/php/php7.4.21/bin/php </pre> 解決方法:找到 PHP 檔案路徑 * [[XAMPP]] on {{Mac}} {{kbd | key=<nowiki>/Applications/xampp/bin/php</nowiki>}} * MAMP PRO on on {{Mac}} input the command ls {{kbd | key=<nowiki>/Applications/MAMP/bin/php/php*/bin/php</nowiki>}} to find the suitable version you want e.g. {{kbd | key=<nowiki>/Applications/MAMP/bin/php/php8.1.13/bin/php</nowiki>}} If you are using zsh. Input the command {{kbd | key=<nowiki>vi ~/.zshrc</nowiki>}} to edit the file<ref>[https://castion2293.medium.com/mac%E4%B8%AD%E5%8D%87%E7%B4%9Aphp%E7%89%88%E6%9C%AC%E4%B8%A6%E8%A8%AD%E7%82%BA%E9%A0%90%E8%A8%AD-d7e6fdad9cc2 Mac中升級php版本並設為預設. 確認目前PHP的版本 | by Nick Zhang | Medium]</ref> 原檔案內容 <pre> alias php='/Applications/MAMP/bin/php/php7.4.21/bin/php' </pre> 修改後檔案內容 <pre> alias php='/Applications/MAMP/bin/php/php8.1.13/bin/php' </pre> And then relaunch the shell === PHPExcel 產生的 Excel 檔案,開啟後看到一堆亂碼 === 狀況1: 開啟 Excel 檔案,看到最前面有 {{kbd | key=<nowiki>NOTICE</nowiki>}} 的錯誤訊息,例如 {{kbd | key=<nowiki><b>Notice</b>: Constant CONST_XXX already defined in <b>path\to\script.php</b> on line xx</nowiki>}} * 解法: 關閉錯誤訊息輸出 ex: [http://www.php.net/manual/en/function.error-reporting.php error_reporting(0);] 以及修正 NOTICE 訊息指涉的問題,例如例子中常數重複宣告的問題。 狀況2: 開啟 Excel 檔案,看到最前面有 {{kbd | key=<nowiki>Fatal error</nowiki>}} 之類的錯誤訊息 * 解法: 關閉錯誤訊息輸出 ex: [http://www.php.net/manual/en/function.error-reporting.php error_reporting(0);] ,以及修正 Fatal error 訊息指涉的問題。 狀況3: 開啟 Excel 檔案,看到有儲存格位址之類的錯誤訊息 * 解法: 該儲存格內容以等號 (=) 開始,卻不是函數。解決方式是將儲存格內容的最前面加一個單引號 (') 或者是加個空白。 == Configuration and Environment Issues == === 不知道網站伺服器載入哪一個 php.ini 設定檔 === 使用 console command<ref>[http://php.net/manual/en/features.commandline.options.php PHP: Options - Manual]</ref> * 輸入命令 {{kbd | key = <nowiki>php --ini</nowiki>}} 或 {{kbd | key = <nowiki>/path/to/php --ini</nowiki>}} <pre> > php --ini Configuration File (php.ini) Path: C:\Windows Loaded Configuration File: C:\xampp\php\php.ini Scan for additional .ini files in: (none) Additional .ini files parsed: (none) </pre> * 使用 [http://php.net/manual/en/function.phpinfo.php phpinfo] 確認「Configuration File」<ref>[http://www.commandlinefu.com/commands/view/818/phpinfo-from-the-command-line phpinfo from the command line | commandlinefu.com]</ref>: {{kbd | key = <nowiki>echo "<?php phpinfo(); ?>" | php | grep "Configuration File"</nowiki>}} ** 指定完整 php 路徑 command: *** {{kbd | key = <nowiki>/Applications/XAMPP/bin/php -r 'echo phpinfo();' | grep "Configuration File"</nowiki>}} *** 或 {{kbd | key = <nowiki>echo "<?php phpinfo(); ?>" | /Applications/XAMPP/bin/php | grep "Configuration File"</nowiki>}} * {{kbd | key = <nowiki>php -i | grep "Configuration File"</nowiki>}} === 執行PHP時顯示原始碼的錯誤 === 確認伺服器是否能執行 PHP * 驗證方式: ** 網頁伺服器放置寫了 [http://php.net/manual/en/function.phpinfo.php phpinfo] 的 PHP 檔案,看是否可以顯示結果。使用後建議移除該檔案,避免對外揭露伺服器環境資訊。或 ** {{kbd | key = <nowiki>php -v</nowiki>}} 如果可以顯示 PHP 版本資訊,代表有安裝 PHP 成功。 * 解決方式: ** 不能執行 PHP 的話,需要檢查 [http://php.net/manual/en/install.php 安裝 PHP] 步驟。 如果 PHP 使用 short tag 語法撰寫,但是沒有啟用 short_open_tag ,會造成顯示原始碼的錯誤。 * 驗證方式: ** 輸入指令 {{kbd | key = <nowiki>php -i | grep short_open_tag</nowiki>}} 確認結果為 short_open_tag = Off * 解決方式: ** 法1: 啟用 short_open_tag (1) php.ini 檔案 需要開啟 short_open_tag = Off -> On (2) 重新啟動網頁伺服器服務,讓 php.ini 修改生效 (3) 驗證 short_open_tag = On ** 法2: 不啟用 short_open_tag,將多個 PHP 檔案的 {{kbd | key=<nowiki><? </nowiki>}} 改成 {{kbd | key=<nowiki><?php </nowiki>}}。 (1) 使用支援 [[Regular expression]] 的文字編輯軟體、(2) 搜尋 {{kbd | key=<nowiki><\?\s</nowiki>}} 取代為 {{kbd | key=<nowiki><\?php </nowiki>}} 。請注意取代部分結尾有一個空白。詳見 [[Batch remove PHP short tags]] === curl error 7 while downloading https://packagist.tw/ ... === Error condition <pre> composer.phar update Loading composer repositories with package information https://packagist.tw could not be fully loaded (curl error 7 while downloading https://packagist.tw/packages.json: Failed to connect to packagist.tw port 443: Connection refused), package information was loaded from the local cache and may be out of date In CurlDownloader.php line 372: curl error 7 while downloading https://packagist.tw/p/zircote/xxx.json: Failed to connect to packagist.tw port 443: Connection refused </pre> Solution * The mirror I was using encountered a network error. * Switch to a different mirror by entering the following command: {{kdb | key=<nowiki>composer config repos.packagist composer https://packagist.org</nowiki>}} === 錯誤訊息: phpinfo() has been disabled === <pre> PHP Warning: phpinfo() has been disabled for security reasons in /path/to/phpinfo.php on line xx </pre> * 原因: 網管關閉使用 phpinfo 替代解決方法: 使用 console command * {{kbd | key = <nowiki>php -i | grep -i "變數名稱"</nowiki>}} 或 {{kbd | key = <nowiki>/path/to/bin/php -i | grep -i "變數名稱"</nowiki>}} for {{linux}} ** {{kbd | key = <nowiki>php -i</nowiki>}} 變數 --info 、 -i 或 -ini,用途顯示PHP資訊或設定值。(PHP information and configuration 摘錄自{{kbd | key = <nowiki>man php</nowiki>}}) ** | 管線命令 (pipe),詳 [http://linux.vbird.org/linux_basic/0320bash.php#pipe 鳥哥的 Linux 私房菜 -- 學習 bash shell] ** {{kbd | key = <nowiki>grep -i</nowiki>}} 變數 -i 代表忽略搜尋關鍵字或搜尋條件 (pattern) 的大小寫 * {{kbd | key = <nowiki>/path/to/bin/php -m</nowiki>}} 列出載入的模組名稱 (無版本資訊)<ref>[http://php.net/manual/en/function.extension-loaded.php PHP: extension_loaded - Manual]</ref> === 錯誤訊息: Allowed memory size of XXX bytes exhausted (out of memory) === * 訊息: PHP Fatal error: Allowed memory size of XXX bytes exhausted (tried to allocate XX bytes) <ref>[https://www.airpair.com/php/fatal-error-allowed-memory-size Fixing PHP Fatal Error: Allowed Memory Size Exhausted]</ref> * 可能原因: ** 一次讀取13萬行的資料,發生記憶體錯誤、 ** 無窮迴圈 (infinite loop) * 解決方法: ** 如果使用 32 位元 (x86) 的 PHP,改成使用 64 位元 (x64) 的 PHP ** 增加 memory_limit<ref>[http://blog.xuite.net/chingwei/blog/30054402-%E3%80%90%E7%B3%BB%E7%B5%B1%E3%80%91PHP+-+Fatal+error%3A+Allowed+memory+size+of+xxx+bytes+exhausted 【系統】PHP - Fatal error: Allowed memory size of xxx bytes exhausted @ My Life :: 隨意窩 Xuite日誌] </ref> ** 跟檔案處理有關: *** (1) 減少每次讀取的資料行數,例如每次只讀取 50 行的資料筆數來做處理。 *** (2) 如果檔案較大,應避免使用一次讀取全部檔案內容的 [http://php.net/manual/en/function.file-get-contents.php file_get_contents]、[http://php.net/manual/en/function.file-put-contents.php file_put_contents] 等函數,讀取檔案建議改成使用 [https://www.php.net/manual/en/language.generators.overview.php Generators] 或 [http://php.net/manual/en/function.fgets.php fgets]、而寫入檔案則可使用 [https://www.php.net/manual/en/function.fwrite.php fwrite] append 方式寫入<ref>[https://davidwalsh.name/basic-php-file-handling-create-open-read-write-append-close-delete Basic PHP File Handling -- Create, Open, Read, Write, Append, Close, and Delete]</ref>。 *** (3) 如果透過 MySQL 執行匯出資料表的 CSV 檔案,則可以不要選擇欄位名稱,而是選擇全部欄位直接匯出。原因:「Rather than attempting to build the object-tree, you could directly try to select the result into a file」<ref>[https://stackoverflow.com/questions/31471186/how-to-export-millions-of-rows-from-mysql-to-csv-via-php-without-exhausting-memo How to export millions of rows from MySQL to CSV via PHP without exhausting memory? - Stack Overflow]</ref> *** (4) 如果跟 json 檔案處理有關,可以搭配使用 [https://stedolan.github.io/jq/ jq] 可以有效處理大檔案的 json 檔案 ** [http://php.net/manual/en/control-structures.foreach.php foreach] 時,與其寫入整個陣列到記憶體,可以改用 [http://php.net/manual/en/language.generators.overview.php Generators] 寫法,節省記憶體的使用。 ** [https://errerrors.blogspot.com/2021/03/allowed-memory-exhausted.html 解決網站伺服器遇到 Allowed memory exhausted 問題] === 錯誤訊息: It is not safe to rely on the system's timezone settings === * 訊息: Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. * 原因: 沒有設定時區 * 解決方法: 使用 date() 或 strtotime() 等[http://php.net/manual/en/ref.datetime.php 時間相關函數]之前,先設定時區,例 {{kbd | key = <nowiki>date_default_timezone_set("Asia/Taipei")</nowiki>}} === composer.phar: command not found 或 Could not open input file: composer.phar === 錯誤訊息: 透過 [https://getcomposer.org/ composer] 安裝 PHP 套件時,例如 {{kbd | key = composer require league/csv}},出現錯誤訊息「composer.phar: command not found」或「Could not open input file: composer.phar」 * 解法I: 如果沒有設定 composer.phar 的 PATH ,需要清楚告知 composer.phar 的完整檔案路徑,例如{{kbd | key = /path/to/php /path/to/composer require league/csv}} * 解法II on {{Mac}}/{{Linux}}: 將下載的 composer.phar 移動到 /usr/local/bin/composer {{kbd | key = mv /path/to/composer.phar /usr/local/bin/composer}},再重新執行安裝套件的指令<ref>[http://stackoverflow.com/questions/21670709/running-composer-returns-could-not-open-input-file-composer-phar php - Running Composer returns: "Could not open input file: composer.phar" - Stack Overflow]</ref>。 == Error Handling and Debugging == === 錯誤訊息: ERROR: 00000:: === * 原因: 想要刪除的資料不在 MySQL 資料庫內,進行刪除時,會發生的錯誤。 * 解決方法: 先檢查該資料是否存在,再進行刪除。 === 錯誤訊息: PHP syntax error “unexpected $end” === 解決方法 * 檢查括弧是否封閉: 使用 [http://notepad-plus-plus.org/ Notepad++]{{kbd | key=ctrl}} + {{kbd | key=b}} 檢查括弧是否封閉 或 使用 [http://www.sublimetext.com/ Sublime Text]{{kbd | key=ctrl}} + {{kbd | key=m}} 檢查括弧是否封閉 * {{kbd | key=<nowiki><?php</nowiki>}} 是否簡寫為 shorttag {{kbd | key=<nowiki><?</nowiki>}} === 錯誤訊息: SMTP Error: Could not connect to SMTP host. === 錯誤訊息: Invalid address: SMTP -> ERROR: Failed to connect to server: Permission denied (13) SMTP Error: Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host. 解決方法 * 檢查 PHP 模組是否安裝 OpenSSL {{kbd | key =<nowiki> php -r "phpinfo();" | grep -i "OpenSSL support"</nowiki> }} 或 {{kbd | key =<nowiki> php -i | grep -i OpenSSL</nowiki> }} for {{Linux}} 預期結果: <pre> OpenSSL support => enabled </pre> * SELinux設定 [http://www.lahory.com/phpmailer-smtp-error-failed-to-connect-to-server-permission-denied-13/ PHPMailer SMTP -> ERROR: Failed to connect to server: Permission denied (13) | Lahory] 預期結果: <pre> # getsebool httpd_can_sendmail httpd_can_sendmail --> on # getsebool httpd_can_network_connect httpd_can_network_connect --> on </pre> 非預期結果: <pre> # getsebool httpd_can_sendmail httpd_can_sendmail --> off # getsebool httpd_can_network_connect httpd_can_network_connect --> off </pre> 需要輸入指令: <pre> # setsebool -P httpd_can_sendmail 1 # setsebool -P httpd_can_network_connect 1 </pre> 相關頁面: [[Email testing]] === COMPOSER 升級 PHPUNIT 版本 6 到 7 遇到問題 YOUR REQUIREMENTS COULD NOT BE RESOLVED TO AN INSTALLABLE SET OF PACKAGES === [https://errerrors.blogspot.com/2018/04/resolve-use-composer-upgrade-phpunit-version-from-6-to-7.html 解決 Composer 升級 PHPUnit 版本 6 到 7 遇到問題 Your requirements could not be resolved to an installable set of packages] === 停止無限迴圈 === [https://stackoverflow.com/questions/9468332/how-can-i-find-out-which-php-script-a-process-is-running-in-linux How can I find out which PHP script a process is running in Linux? - Stack Overflow] <pre> ps aux | grep php </pre> [https://superuser.com/questions/800207/how-do-i-find-and-kill-a-php-loop-process command line - How do I find and kill a php loop (process)? - Super User] <pre> pkill -9 php </pre> [https://www.geeksforgeeks.org/php-shell_exec-vs-exec-function/ PHP | shell_exec() vs exec() Function - GeeksforGeeks] Or input the {{kbd | key=kill}} command to stop the process if you have the permission. See details on [[Linux_commands#Show_the_process_list_.26_kill_the_process]] === Json errors === [[Resolve PHP json decode error]] === phpgrid: Couldn't execute query === [http://www.phpgrid.org/ PHP Grid Framework] 錯誤訊息: Couldn't execute query. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ... * 解法: 查詢語法中包含複雜的 sub query 雖然可以順利呈現查詢結果,但是搜尋篩選時出現查詢錯誤。如果要使用 phpgrid ,建議降低查詢的複雜度。 == General PHP Practices == === Using PHP from the command line === [[Execute php script in a bat file]] === 移除非預期的空白(全形空白) === 需要額外移除 [http://www.fileformat.info/info/unicode/char/3000/index.htm 'IDEOGRAPHIC SPACE' (U+3000)] 全形空白 <pre> $string = str_replace(json_decode('"\u3000"'), "", $string); $string = trim($string); </pre> More on: [[Data_cleaning#Remove other string look like whitespace | Remove other string look like whitespace]] == 使用者操作/使用者輸入的內容 == [[Web user behavior]] == 避免的 coding 習慣 == [[Maintain legacy code]] == unified coding style == variable: $var * PHP: starts with dollar symbol $var<ref>[http://www.php.net/manual/en/language.variables.basics.php PHP: Basics - Manual]</ref> * javascript: the first character can be a letter or _ or $, and the other characters can be letters or _ or $ or numbers.<ref>, and the other characters can be letters or _ or $ or numbers.</ref> == PHP function and its reversed function == * [http://php.net/manual/en/function.mysql-real-escape-string.php PHP: mysql_real_escape_string] e.g. {{kbd | key=<nowiki>Tom\'s Adventure</nowiki>}} ↔ [http://php.net/manual/en/function.stripslashes.php PHP: stripslashes] e.g. {{kbd | key=<nowiki>Tom's Adventure</nowiki>}} == tools == tester * ''$'' [https://itunes.apple.com/us/app/php-code-tester/id415087689?mt=12 PHP Code Tester] for {{Mac}} documentation * [https://itunes.apple.com/us/app/dash/id449589707?ls=1&mt=12 Dash 3] for {{Mac}} - API Docs & Snippets. Integrates with Xcode, Alfred, TextWrangler and many more. on the Mac App Store * [http://devdocs.io/ DevDocs API Documentation] == References == <references/> {{Template:Troubleshooting}} [[Category:PHP]] [[Category:Programming]] [[Category:Linux]] [[Category:User behavior]] [[Category:Web Dev]]
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Kbd
(
edit
)
Template:Kdb
(
edit
)
Template:Linux
(
edit
)
Template:Mac
(
edit
)
Template:Troubleshooting
(
edit
)
Template:Win
(
edit
)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information