codeigniter-2

Codeigniter cron job not working

谁都会走 提交于 2019-11-26 23:13:20
I have a cron job like this: /usr/bin/php /var/www/website/public_html/index.php className methodName If I run it in terminal it runs, but outputs nothing. If I pass a wrong method name it runs successfully. If I pass wrong class name it outputs a website 404 error. I also have a routing which adds "en" into url, for example http://www.website.com/en/home/index could this be the problem? my settings of config.php are: $config['uri_protocol'] = 'AUTO'; $config['index_page'] = ''; the steps to prepare CodeIgniter 2.x for cron-jobs via CLI (command line interface): 1st: create a copy of your root

Extending The Controller Class in CodeIgniter

青春壹個敷衍的年華 提交于 2019-11-26 22:52:23
I have class MY_Controller extends CI_Controller and common logic for big profile section, so I'va tried to create class Profile extends MY_Controller with common logic for profile section and all class related to this section should extends this Profile class as I understand right, but when I tried to create class Index extends Profile I recieve an error: Fatal error: Class 'Profile' not found CodeIgniter tries to find this class in index.php which I am running. Where is my mistake? Or maybe there is anoter better way to mark out common logic? I take it you have put your MY_Controller in

Only variable references should be returned by reference - Codeigniter

倾然丶 夕夏残阳落幕 提交于 2019-11-26 21:18:23
After the server PHP upgrade I am getting the following error with PHP Version 5.6.2 on Apache 2.0 A PHP Error was encountered Severity: Notice Message: Only variable references should be returned by reference Filename: core/Common.php Line Number: 257 How can I fix this? Techie Edit filename: core/Common.php, line number: 257 Before return $_config[0] =& $config; After $_config[0] =& $config; return $_config[0]; Update Added by NikiC In PHP assignment expressions always return the assigned value. So $_config[0] =& $config returns $config - but not the variable itself, but a copy of its value.

Codeigniter echoing [::1] instead of localhost

时光毁灭记忆、已成空白 提交于 2019-11-26 18:21:02
问题 I am using CodeIgniter 3 as a web platform and trying to import semantic-UI CSS into my page. I'm doing so by using CodeIgniter's base_url() method in the href property for the CSS import. However, semantic.css itself imports some other fonts present on my server, which are then unable to load because of Cross-Origin resource sharing policy. This is the error message chrome gives me: Font from origin ' http://[::1] ' has been blocked from loading by Cross-Origin Resource Sharing policy: No

Send email by Email Class in codeigniter with Gmail

二次信任 提交于 2019-11-26 16:48:31
问题 I want send a email by Email Class in codeigniter with gmail, but i get following error: Error: A PHP Error was encountered Severity: Warning Message: mail() [function.mail]: Failed to connect to mailserver at "ssl://smtp.googlemail.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() Filename: libraries/Email.php Line Number: 1553 This is my full function in controll: function send_mail(){ $config['protocol'] = 'smtp'; $config['smtp_host'] = 'ssl://smtp

Codeigniter 2 on IIS with web.config file

被刻印的时光 ゝ 提交于 2019-11-26 16:45:33
问题 I have a codeigniter app working fine locally with WAMP. However, I am having trouble getting it to work on an IIS server. Please note that I do not want to enable query strings. Here is what I currently have in my web.config file: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Clean URL" stopProcessing="true"> <match url="^(.*)$" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST

CodeIgniter: “The filetype you are attempting to upload is not allowed.”

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 14:44:16
I'm experiencing a very odd upload problem. Here's the relevant view file: <form action="http://localhost/index.php/temp/upload/" method="post" enctype="multipart/form-data"> <fieldset> <input type="file" name="userfile"/> <input type="submit" value="Upload"/> </fieldset> </form> And here's my temp controller's upload() method: public function upload() { $config['upload_path'] = FCPATH . 'uploads' . DIRECTORY_SEPARATOR; assert(file_exists($config['upload_path']) === TRUE); $config['allowed_types'] = 'avi|mpg|mpeg|wmv|jpg'; $config['max_size'] = '0'; $this->load->library('upload', $config); if

Cannot remove index.php from CodeIgniter URL

安稳与你 提交于 2019-11-26 14:30:55
问题 My directory structure is /var/www/CI/ with all the folders viz., application, system under the folder CI. Have created a .htaccess file under CI. Following is the code in .htacess. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.php|public|images|robots\.txt|css) RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> Still localhost/CI/blog gives 404 error. Can anyone guide as to where this rule is wrong? 回答1

escapeshellarg() has been disabled for security reasons

岁酱吖の 提交于 2019-11-26 12:48:14
问题 When I want to upload anything in any form I see the Warning: escapeshellarg() has been disabled for security reasons message on my site. What can I do to fix this? My framework is codeigniter final version. Here is the full warning: A PHP Error was encountered Severity: Warning Message: escapeshellarg() has been disabled for security reasons Filename: libraries/Upload.php 回答1: The @ operator will silence any PHP errors the function could raise. You should never use it! Solutions: Remove the

Routing controllers in subfolders using CodeIgniter

﹥>﹥吖頭↗ 提交于 2019-11-26 11:28:56
问题 since i want to separate the frontend and backend of the system. i have created 2 folders inside controllers as frontend and backend Below is the structure of my controller folder controller --frontend ---store.php ---processing.php ---profile.php ---authenticate.php ---register.php --backend ---authenticate.php ---stats.php ---users.php ---property_manage.php ---register.php i can access the functions by using frontend/store/add frontend/store/manage ...... backend/stats/sales backend/stats