TYPO3 can't access to root folder - php

I am new in TYPO3, I have a running system online and wanted to copy to my localhost, I copied the folder in /var/www/my_production/
I created the database, I can access to the backend without problem but I cant open my site, I get this error :
1323059807: You are not allowed to create directories in the folder "/" (More information)
TYPO3\CMS\Core\Resource\Exception\InsufficientFolderWritePermissionsException
thrown in file
/var/www/my_production/typo3/sysext/core/Classes/Resource/ResourceStorage.php
in line 2021.
Any idea how I can fix that problem?
EDIT ::
After clearing the cache from the Install Tool, I got :
Fatal error: Call to undefined function
TYPO3\CMS\Core\Utility\xml_parser_create() in
/var/www/clevvermail_dev/typo3/sysext/core/Classes/Utility/GeneralUtility.php
on line 2252

One possible cause is that XML is missing.
Try: sudo apt-get install php7.0-xml or sudo apt-get install php5.6-xml

First steps for each new TYPO3 installation: enter Install Tool and reduce all errors possible. (You might stay with some errors, but you need to understand them.)
TYPO3 gives a lot of hints what has to be changed.
typical errors:
missing directories
missing rights in directories
wrong configuration in php.ini
missing php modules
database errors (connection, user, password)
try to solve these errors first.
Since TYPO7 you can check your extensions from the Install Tool.
For earlier versions:
disable all additional extensions (in PackagesState.php) and get the core working, then enable one extension after the other.

Related

PHP Composer does not clone symfony/assetic-bundle properly

I am trying to install Symfony on CentOS Linux wih PHP 5.6 and cPanel installed.
When I run composer require symfony/assetic-bundle , once adding bundle to the AppKernelphp, symfony (app/console too) stops working and keeps logging this error:
[10-Jun-2016 22:00:57 UTC] PHP Fatal error: Class 'Symfony\Bundle\AsseticBundle\AsseticBundle' not found in /home/avid24/public_html/app/AppKernel.php on line 19
After checking the vendor directory, turns out that composer has downloaded a single compressed file with a random name, I could extract it with unzip. but problem still exists!
This environment works properly on windows and I could easily update symfony and its components using composer.
Any help? Anyone with the same experience ?
Well, I eventually figured out the problem!
I enabled suhosin extension which prevents the composer and other similar command prompt php scripts from a proper execution.
As a temporary solution I copied php.ini and disabled unnecessary extensions and put it next to my project and call composer this way
$php -c ../composer-php.ini ~/composer ......
I'll create a script to make the life easier
I didn't find any resource which describes coexistence of composer and suhosin extension, so I'm not sure if this is the ultimate solution but the root cause is identified.
If anybody makes workaround this subject I'd be more than happy to know about it.

Unable to install wordpress theme - ubuntu

I recently created an ubuntu virtual server(EC2) on Amazon Web Services, then installed wordpress through console apt-get install wordpress , before that I installed, apache, php and mysql. The website is running, but the problem is that I can't install wordpress themes, I get this message:
Downloading install package from https://downloads.wordpress.org/theme/twentysixteen.1.1.zip…
Unpacking the package…
Could not create directory.
I already give the right permissions to these folders :
usr/share/wordpress/wp-content,
usr/share/wordpress/wp-content/themes,
usr/share/wordpress/wp-content/plugins,
usr/share/wordpress/wp-content/languages
And added this line:
define('FS_METHOD','direct');
to usr/share/wordpress/wp-config.php
at the end.
I don't know what else to do.
Thank you.
I recently figure out how to fix it, I edited this file:
/etc/wordpress/config-mydomain.com.php
And found this line:
define('WP-CONTENT-DIR','srv/www/wp-content/localhost');
This must be replaced by:
define('WP-CONTENT-DIR','var/www/html/wordpress/wp-content');
This often happen when you use this file to create your database and setup your files in ubuntu: usr/share/doc/wordpress/examples/setup-mysql
And then you can install themes without problems, but you must give aproppiate permissions to the folders wp-content, themes, etc. after fix this!!
You could try defining the content directory
define('WP_CONTENT_DIR', '/var/www/wordpress/wp-content');

Getting [ErrorException] - installing yii2 using composer

I am trying to install Yii2 on WAMP using composer.
c:\Users\username>php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.0
I am getting the following error when I run the command which is given above.
[ErrorException]
Argument 1 passed to Fxp\Composer\AssetPlugin\Repository\BowerRepository::createVcsRepositoryConfig() must be of the type array, null given, called in C:\Users\username\AppData\Roaming\Composer\vendor\fxp\composer-asset-plugin\Repository\AbstractAssetsRepository.php on line 136 and defined
Can someone help solving this error? But, it is created a folder named "basic".
I have copied this folder to D:\wamp\www and when I access localhost/basic/web/ from browser, I am getting the following error.
ReflectionException
Class yii\debug\Module does not exist
I am following the instructions to install yii2 from http://www.yiiframework.com/download/
Please assist me to resolve these issues.
Thanks
First windows does not have a curl processor like unix so you need to use the other option for installing Composer
php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
For this to work you need the php.exe processor to be on your path, so you have 2 options here. Either add the c:\wamp\bin\php\phpx.y.z folder to your PATH or my prefered option write yourself a little .cmd file which will do it for you like this
addphp.cmd
PATH=%PATH%;c:\wamp\bin\php\phpx.y.z
Put this file in a folder already registered on your path so you can run it from anywhere in a command window.
Now you will have to edit the \wamp\bin\php\phpx.y.z\php.ini file. This is similiar to the one used by php code run through the Apache web server but is only used by the PHP CLI (Command Line Interpreter)
Make sure the extension php_curl is uncommented or the above line wont work i.e. remove the ; comment symbol
extension=php_curl.dll
So now run a command window, cd into the folder that you want composer installed into and run the command above, then follow the rest of the install instructions on Install instructions
EDIT: Thank you for reminding me.
This error happens because of invalid json on plugin you or application requested (npm or bower).
The link here suggests you to run:
composer global update.
This will update composer cache. Hope it helps.

Using Composer PHP on Shared Space

I'm using Bluehost and do have access to SSH, thankfully. I've also set my PHP to 5.4 in the Control Panel settings. Now, here's the two big questions that I can't seem to grasp: how do I install Composer and furthermore, after installing Composer, how do I get the dependencies included?
In this case, I am attempting to use the official Tumblr PHP Library, which has dependencies -- all of which can be found on Packagist.
I've referred to this question in which the OP is using HostGator. I have attempted to install Composer in a similar fashion and have done so with seemingly successful results. The issue, however, is that I don't know where to install it on Bluehost so I now have Composer installed in several random places on the server simply because I don't know how to navigate to find where to put it in this shared space.
I know this is the issue (i.e. it's installed in the wrong place) because when I use the composer phar files and syntax to install the packages, I get errors saying the commands don't exist.
I really hate asking for hand-holding assistance, but if someone could walk me through the proper installation of Composer on a shared space and the proper installation of a Composer package from Packagist on the same shared space, it would be much appreciated. I've dug through the Composer documentation and can't seem to find a proper guide -- if one can even exist -- for this case. At this point, I'm wondering if it's going to be different for every web host.
Once you install composer as mentioned by KLVTZ. In the bluehost environment, use the php-cli instead of php.
php-cli composer.phar install
When installing composer, the biggest problem I ran into was that Bluehost's command line php was 5.2 and composer needs 5.3+.
Fortunately, Bluehost does give you access to 5.4. You can find it at
/ramdisk/php/54/bin/php54-cli
I ended up setting up an alias to call composer.phar using the above php command and it's worked great. You can see more details on how to install composer on bluehost.
You should probably not use Composer on the remote host, but instead install it on the local machine that is used to upload your project to Bluehost. There you can manage all the stuff that is needed to fetch the dependencies, which might include having the ZIP extension enabled or having a ZIP program available, having GIT or Mercurial installed if you have to grab a version from a branch, and so on.
All these dependencies of using Composer might not be available on that remote host, and frankly: You really do not want to install these development tools on a production machine anyway, I think. Any software that potentially helps an attacker shouldn't be present if it can be avoided.
The issue, however, is that I don't know where to install it on Bluehost...
In order to fix this problem, you need to figure out where exactly your project folder is. Composer needs to be installed in that folder. If you have access to a UNIX shell, I recommend that you change your directory to that project folder
cd $_SERVER['DOCUMENT_ROOT']/project_folder/
Generally, your remote server will follow the same file directory tree as that on your local machine. However, if you are unsure as to how your file structure may be organized, you can always print working directory of your local machine:
pwd
After you have successfully located the correct file path on your shared space, simply install composer:
curl -sS https://getcomposer.org/installer | php
This will report back something like:
All settings correct for using Composer
Downloading...
Composer successfully installed to: /var/www/my_project/composer.phar
Use it: php composer.phar
You now have access to your composer.phar in your project. Let me know if you need any further help.
One problem on Bluehost is that the php command on Bluehost does not execute php-cli. So I "bypass" that by having my own php script earlier in the PATH and then forwarding the arguments to php-cli. In the same process I made script named composer which calls php-cli composer.phar directly.
So, this setup has worked for me on Bluehost:
In ~/bin I have the composer.phar and two bash scripts called php and composer. In ~/.bash_profile I have prepended ~/bin to my PATH.
~/bin/php looks as follows:
#!/bin/bash
php-cli "$#"
~/bin/composerlooks as follows:
#!/bin/bash
php-cli ~/bin/composer.phar "$#"
And the additions to ~/.bash_profile are these:
PATH=$HOME/bin:$PATH
PATH=$PATH:$HOME/.composer/vendor/bin
export PATH
(I have also added ~/.composer/vendor/bin as can be seen, this is handy for global access for some composed applications (for me that is laravel)).
Remember to source ~/.bash_profile. (Or reconnect)
I think you should do something like this.
In console
echo $PATH
Use one of these pathes
mv composer.phar {selected path}/composer
chmod +x {selected path}/composer
Now you can simply call composer everywhere
If you have composer installed in your root directory (under public_html), might be something related to PHP version. As Bluehost when chosing PHP version "Be aware that this only modifies your ~/public_html/php.ini file. If you choose to use PHP 5.4, you'll want to make sure your crons use "/usr/php/54/usr/bin/php" instead, as otherwise it will use PHP 5.2."
So you can try with the command
/usr/php/54/usr/bin/php-cli composer.phar install

Upgrading PEAR in command prompt: "Error:Failed to mkdir C:\..."

I've just installed PEAR into WAMP attempting to follow this article. It all seems to have gone okay but when I type "pear upgrade" into the command prompt I get this error:
ERROR: failed to mkdir c:\php\pear\docs\Archive_Tar\docs
It is looking on the wrong drive (and missing a subdirectory in that path by the looks of it). It should be looking for D:\php\php5.3.13\pear\docs\Archive_Tar\docs
When specifying installation directories I chose ones on the D:\ and thats where the folder structure is, the include_path in both php.ini locations have also been updated. I've also reset the WAMP server after making the changes.
How do I set it to look / install the package in the right place?
My advice is to remove your complete PEAR installation and install from scratch. It'll save you time and sweat. If you have the time and patience, you can fix PEAR parameters with the config-* subcommands:
C:\>pear
Commands:
[...]
config-create Create a Default configuration file
config-get Show One Setting
config-help Show Information About Setting
config-set Change Setting
config-show Show All Settings
Start with pear config-show to inspect current values and see if you can spot invalid ones.

Categories