How to deploy a Zend new project - php

I am currently trying to update a previous web site using Zend Framework.
As I dont want to work in a local network, I subscrided to a pro offer of OVH server.
So I put my old website in the www folder, I uploaded the Zend Framework directory (ZendFramework-1.11.11), and then created a foder dev in the root directory as well.
As I got this error when I try to create a new project with putty :
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in xxxx/ZendFramework-1.11.11/bin/zf.php on line 38
This seems to come because the serveur is running with php 4 instead of 5.
I created a .htaccess file including the following line :
SetEnv PHP_VER 5
When I use phpinfo(); in www/phpversion.php, it says it is PHP5. ...
But when I use php -v with putty, it keeps saying I am using php 4.4.9
Annyone has an idea to help me upgrading the server php version, and to help me creating my new project ??
Many thanks

Assuming you use a LAMP setup with debian as the operating system do this as root:
aptitude install libapache2-mod-php5 php5 php5-cli
and then retry. You may add some other packages like php5-gd or php5-suhosin etc.

Related

Updating Apache2 after installing PHPMyAdmin and PHP 8.1

Today I installed PHPMYAdmin on Ubuntu Focal Fosset. I got the message
apache2_reload: apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.4.load: Cannot load /usr/lib/apache2/modules/libphp7.4.so into server: /usr/lib/apache2/modules/libphp7.4.so: cannot open shared object file: No such file or directory
The simple explanation is I no longer use PHP 7.4 as I updated to PHP 8.1.
How do I update in order to have php8.1.conf and php8.1.load instead of php7.4.conf and php7.4.load ?
Thanks.
PS: I just looked at etc/php and noticed there 2 files, one entitled 7.4 and the other 8.1. Should I delete the first one?

php7ts.dll cannot load into server

Today I have installed php7, but when I restart the apache, it couldn't start. again despite I edited the httpd-xampp.conf file to config php7.
anyway I went to C:/xampp and run the apache_start.bat, then I saw the following error
Apache 2 is starting ...
httpd.exe: Syntax error on line 456 of C:/xampp/apache/conf/httpd.conf: Syntax error on line 17 of C:/xampp/apache/conf/extra/httpd-xampp.conf: Cannot load C:/xampp/php/php7ts.dll into server: The specified module could not be found.
after that I checked those file and saw they're exist.
what can I do now?
thanks in advance...
You need to have all the components installed in the same x64/x86 version :
Apache (httpd.exe -v to find out which one is installed)
PHP 7 (php.exe -v to find out which one is installed)
Visual C++ Redistributable for Visual Studio 2015 (check the list of your installed softwares on Windows)
If one of the above component is not in the same version than the others, you could get the module could not be found error.

Laravel error after changing php version

I just setup php 7.0.27 in both webserver and cli. My laravel project was working just fine before in php 7.2. When I try run command php artisan serve it shows an error:
PHP Parse error: syntax error, unexpected '?', expecting variable
(T_VARIABLE) in /var/www/html/pmanager/pmanager/vendor/symfony/console
/Output/Output.php on line 40
I followed this github discussion which says that the solution is installing same versions in cli and webserver, which, in my case is fine. I have 7.0.27 in both.
Another thing they are pointing it out is laravel shows this error with php 7.0. I cannot change my php version to 7.1 or 7.2 because I must stick with it so as to run magento 2.1 projects.
Any help without changing php version would be highly appreciated.
you can downgrade your laravel 5.6 project to 5.5!!
Changing the value of the Laravel version inside the composer.json file to the laravel 5.5.
Delete /vendor folder and run composer install

Laravel thinks that my PHP version does not meet their minimum requirement even if it isn't

I changed my php version into 5.6 but when i run composer update it still thinks I am using 5.4 version.
The version of my server is 5.4 but I changed my project directory php version in to 5.6. I changed that one via cpanel php configuration. Here's the screenshot:
As you can see i changed my project directory php version in to 5.6, but when i run composer update, it still thinks that i am using 5.4 version.
I also tried adding this in my composer.json:
"platform": {
"php": "5.5.9"
}
And when I run composer update, it installs some dependencies except for the last one..it is giving me this error:
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home3/idmadm/public_html/app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 146
When I checked line 146 of helpers.php, this is the code:
function auth($guard = null)
{
if (is_null($guard)) {
return app(AuthFactory::class); //THIS IS THE CODE!!
} else {
return app(AuthFactory::class)->guard($guard);
}
}
I researched about that error and some said it's because of my PHP Version. I guess Laravel still think that my PHP Version is 5.4 where in fact, i changed it into 5.6.
How can i let Laravel know that I am using PHP Version 5.6.
Any help please!
Your help will be greatly appreciated and rewarded!
Thanks! :)
PS: The reason why I am changing PHP version in the directory because some websites that are hosted in my server do not support PHP 5.5+.
Remove composer and install again. Because when you install composer, it is written the route of php folder as path. And you should update this path now.
Normal server with cpanel has 2 PHP:
PHP for internal use /usr/local/cpanel/3rdparty/bin/
other for use with apache on /usr/local/lib.
Sysadmin install composer over /usr/local/cpanel/3rdparty/bin/ and this it's now, PHP 5.4.31
/usr/local/cpanel/3rdparty/bin/php -v
You have two option.
Speak with your hosting for Sysadmin install composer using PHP uses be Apache
Instal composer on your shared account (best way)

Error loading PHP 5.5 Module into Apache 1.3 (OpenBSD version) on OpenBSD 5.6 platform

I am trying to configure a server using Apache 1.3 (apache-httpd-openbsd) , PHP 5.5 and MySQL on an OpenBSD 5.6 machine.
The problem occurs when i try to load the PHP module into Apache. I have added the following line in my httpd.conf file:
LoadModule php5_module /usr/local/lib/php-5.5/libphp5.so
The problem is that when i try to load this file by using
apachectl start
I get a bunch of errors like this:
/usr/local/sbin/httpd:/usr/local/lib/php-5.5/libphp5.se: undefined symbol 'apr_bucket_eos_create'
It seems that the PHP library refers to APR methods in Apache that should be included in the Apache distribution that i have. How can i help PHP to find those methods and be able to run on my server?
I found the issue and the solution.
After investigating my configuration further I noticed I had the Apache 2 version of PHP installed (php-5.5.14p0-ap2) instead of the correct 1.x one (php-5.5.14p0). APR in the 1.x versions of Apache uses "ap_" instead of "apr_" in their method signatures which was the cause of the problem.

Categories