I'm trying to get a site up and running on a VPS server running cpanel.
I've uploaded the site and configured to point at the public folder which appears to be working (or pointing to the right folder)
However I'm getting a 500 server error. In an error_log I'm getting this error:
[18-Aug-2016 21:44:09 UTC] PHP Fatal error: Call to undefined function Symfony\Polyfill\Mbstring\iconv_strpos() in /home/spadsdrama/public_html/vendor/symfony/polyfill-mbstring/Mbstring.php on line 351
SO it looks like PHP is missing this function?
PHP version is 5.6
Laravel 5.2
Pulling out my hair to get this sorted
I had this site working correctly on a Plesk server but switched to a Cpanel one (might be regretting this now!)
What am I missing - what configuration is missing?
Thanks
You need to install http://php.net/manual/en/book.iconv.php PHP extension for this function support. You can do this from ISP-manager of VPS, if it exists, or with SSH console server.
Related
I can execute my php scrape file by typing in the address bar:
domain.com/scrape.php
However, I try to use cron job on my shared server on host gator by this command:
/usr/bin/php-cli public_html/scrape.php
I got this error message:
Fatal error: Call to undefined function GuzzleHttp\Handler\curl_reset() in /home4/username/public_html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 78
I already update my php version to stable 5.6 or even 5.7 version also same error. I think that it should not be php version error because I still can execute the file from browser right ?
Also I cannot reboot server Apache because hostgator support said they cannot reboot it until the server is totally down...
Any help please ! Thank you !
I ran into this problem last week on my own server. As it turned out, my browser was looking at one installation of PHP and cron was looking at a 2nd installation of PHP. One way to check is to run a PHP script through your browser that executes phpinfo(). That will tell you what the browser is running. Have cron do the same and save the results. Compare the two and make sure they're pointing to the same installation of PHP. Don't just check versions. Check install paths and loaded modules. Cheers.
Thanks for your help in advance. I have been working on this bug for more than 12 hours now.
There is an AJAX signup form in my Heroku site which runs on MySQL and is connected to ClearDB Database. I can successfully send data to the database on my local server (MAMP). However, I cannot do the same on the server.
The requests cannot get send to the database and gets stuck at loading. Upon inspection I realise it is a PHP 500 Error.
I found the key problem in the Heroku logs. 2014-11-24T15:02:31.238493+00:00 app[web.1]: [24-Nov-2014 15:02:30 UTC] PHP Fatal error: Call to undefined function mysql_connect() in /app/index.php on line 5
Line 5 of the index.php is mysql_connect('hostname', 'username, 'password');
I have tried running php_getinfo(); and found that there is no MySQL support in the server. On a side note, I have MySQL support in my localhost.
The server php.ini paths are as such: Configuration File (php.ini) Path /app/.heroku/php/etc/php & Loaded Configuration File /app/vendor/heroku/heroku-buildpack-php/conf/php/php.ini
What should I do?
mysql_* functions are deprecated and actually removed in the next PHP version. Check out mysqli.
Worth noting that you can enable mysql_* on Heroku via composer.json. This is documented in Heroku's devcenter docs on PHP support.
Also recommend you consider using a more modern MySQL library, though :)
I have PHP 5.4.30 installed and running well using the FastCGI module and IIS 8 (on Windows 8.1). I have MySQL installed and would like to manage it with phpMyAdmin, however, I get this error whenever I try to access the page:
Fatal error: Call to undefined function mb_detect_encoding() in C:\inetpub\wwwroot\phpmyadmin\libraries\php-gettext\gettext.inc on line 177
Many older threads I have seen suggest adding extensions to the php.ini, but in the later versions of php, the php.ini file becomes php.ini-production and php.ini-development. Whenever I try to modify either of these files or create a php.ini file, I get an error 500 when trying to visit other php pages. I have also seen many solutions related to Xampp / Apache, but none of them seem to work in IIS 8 (that I have found).
Thanks in advance for any suggestions!
You probably need the php_mbstring.dll file installed. You can find it on the PHP Windows Extensions page
I'm migrating my CakePHP site from a local Xampp installation to an EC2 ubuntu environment. I moved over the DB, and copied the web directory files over to the EC2 instance, but upon accessing the site I get this error:
Fatal error: Class 'AppController' not found in /var/www/cakephp/lib/Cake/Controller/CakeErrorController.php on line 31
I looked into the Apache error log and found that the piece it wasn't liking was this:
$this->Auth->user()['role']
The error said the PHP parser wasn't expecting the '['. This all worked fine in the default local Xampp install, so I'm assuming this is a PHP difference between the two installs?
Xampp: PHP 5.4.7
EC2: PHP 5.3.10
Any idea of any settings or anything that could cause this behavior?
That is a new feature in php 5.4 see http://docs.php.net/manual/en/migration54.new-features.php the third bullet item.
For php 5.3 you will need to assign it to a variable
$user = $this->Auth->user()
$role = $user['role'];
I've installed WAMP Server on my computer so that I can develop my website, however I have come to run my existing code which is running on my staging host just fine without any errors.
I'm getting errors such as:
Fatal error: Cannot redeclare session_status() in >C:\wamp\www\uquiz\trunk\sessions\session.php on line 277
I have uncommented the line in the PHP config:
;zend_extension = "c:/wamp/bin/php/php5.4.3/zend_ext/php_xdebug-2.2.0-5.4-vc9-x86_64.dll"
But this hasn't suppressed the error.
I'm assuming that it's the ZEND Framework that may have already declared the function session_status()?
If I change the name of the function, the error disappears, but I don't want to be restricted.
It's a built-in PHP function as of 5.4.
Rename your function or downgrade to PHP 5.3
http://us.php.net/session-status