Magento custom package not setting file permissions right - magento

I made a custom package for Magento, I'm on 1.9.1.0. I did it from Admin package manager. I installed the package from "Magento Connect Manager", it installs without error; the only problem is that my PHP file in the package is installed with "666" permission instead "644", so it won't be run by the PHP processor, because of the faulty permission. Any idea how to fix this?
The file used to make the package had right permissions "644". The syntax of my package.xml file is correct, as far as I can tell:
<?xml version="1.0"?>
<package>
<name>Magento_Iframe_Finder</name>
<version>1.4.7.3</version>
<stability>stable</stability>
<license uri="http://www.opensource.org/licenses/OSL-3.0">OSL-3.0</license>
<channel>community</channel>
<extends/>
<summary>Magento iframe finder.</summary>
<description>Magento iframe finder.</description>
<notes>Easy to install and use</notes>
<authors><author><name>John Doe</name><user>auto-converted</user><email>johndoe#gmail.com</email></author></authors>
<date>2015-12-19</date>
<time>08:04:22</time>
<contents><target name="mageweb"><dir name="errors"><file name="iframefinder.php" hash="54abb08163b654dd08635b40220c02e2"/></dir></target></contents>
<compatible/>
<dependencies><required><php><min>4.7.1</min><max>6.8.9</max></php></required></dependencies>
</package>
Any idea if there's a "switch" that I can add to my "package.xml" file to set the right file permissions to my file?

Since nobody has an answer I found it myself.
Default Magento file permissions are: 777 for directories and 666 for files, in the "Magento Connect Manager" you can change them to 755 and eventually 644 then packages will install correctly.

Related

How do you make xdg-utils detect a file association for my application from a distribution package?

I am building a distribution package for xnec2c and I want .nec files to associate with xnec2c and also display the associated icon.
(This question is different than the many xdg-utils answers out there because it asks about packaging and whether xdg-* calls are actually necessary.)
I know I can register them with these:
xdg-mime install --mode system x-nec2c.xml
xdg-icon-resource install --mode system --context mimetypes --size 256 xnec2c.png application-x-nec2
xdg-mime default xnec2c.desktop # but `man` says not as root?
Should it be sufficient just to drop the .xml and .desktop and .png in the right place on the filesystem?
Does the post-install in the package need to run some or all of these commands?
I read here that the icon would be application-x-nec2 and not application/x-nec2. Is this correct?
I would like the files to work by placing them in the right spot without running the xdg-* tools if supported.
(The package is a .rpm, but type and distro shouldn't matter since xdg is a standard. I want the same basic process to work for .deb, too.)
Everything should associate as the mime type application/x-nec2 since "nec2" is the file format for ".nec" files. This is reflected in the .desktop and .xml definitions below unless I have an error. Please correct me if I have something out of place!
Here are the relevant files that deploy:
/usr/share/applications/xnec2c.desktop (see below)
/usr/share/mime/packages/x-nec2.xml (see below)
/usr/share/pixmaps/xnec2c.svg
/usr/share/icons/hicolor/256x256/apps/xnec2c.png
/usr/share/icons/hicolor/scalable/apps/xnec2c.svg
and here are is the content:
==> /usr/share/applications/xnec2c.desktop <==
[Desktop Entry]
Name=Xnec2c
GenericName=NEC2 Simulator
Comment=Numerical Electromagnetics Code software
Exec=xnec2c
Icon=xnec2c
Terminal=false
Type=Application
Categories=Science;
Keywords=nec2;em;simulator;
X-Desktop-File-Install-Version=0.22
MimeType=application/x-nec2;
==> /usr/share/mime/packages/x-nec2.xml <==
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/x-nec2">
<comment>NEC2 Antenna Simulation File</comment>
<icon name="application-x-nec2"/>
<glob-deleteall/>
<glob pattern="*.nec"/>
</mime-type>
</mime-info>
You don't need to run the mime-* tools, but you do need to update the desktop and icon associations for the freedesktop environment after install like so:
update-mime-database /usr/share/mime
update-desktop-database
gtk-update-icon-cache /usr/share/icons/hicolor
These should be run after uninstall, too, to cleanup after removal. In RPMs this is the %postun section.
Substitute /usr/share with whatever deployment variable you might use like %{_datadir} for RPM .spec's.
Also the icon name had an issue. It should have just been named 'xnec2c' not 'application-x-nec2' because the 'xnec2c' icon gets installed with the installer as follows:
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/icons/hicolor/256x256/apps/%{name}.png

Joomla "Fatal error: Cannot redeclare jblogerror() in on line 0"

Here is a weird problem i'm facing; after updating Joomla to the latest version, website failed to up load but, as i've made a backup manually from these folders:
administrator
bin
cli
components
includes
layouts
libraries
modules
plugins
yt-assets
and all the root files, after restoring the backup still the website is not loading and just says
"Fatal error: Cannot redeclare jblogerror() in on line 0" !
Any suggestion? Thank you.
Apparently, the version of jBlog you are using is loading its attempting to load its own classes twice.
Let's assume the jBlog developers already fixed it and you carelessly ignored the warning to ensure all your extensions are compatible before updating.
Are you able to access administrator? Simply go there and upgrade jBlog including any modules.
Else, the issue lies within a plugin. In order to access the administrator and perform the update, you will need to manually disable the offending plugin.
A simple way is to rename its folder: start from plugins/system then plugins/content hopefully you'll have spotted it by then. Look into the subfolders of each and spot any that may be relevant to jBlog (or grep through the folder to locate the specific string)
If you have console access, simply run
# grep -rl jblogerror plugins/system
and you should see all the files that include such string, just rename their main plugin folder. But you could also do all this through ftp and guessing.

magento2 weird issue for There are no commands defined in the "setup" namespace

I am facing below issue in my entire installations of M2.
[InvalidArgumentException]
There are no commands defined in the "setup" namespace.
weird thing is I installed fresh Xampp and set up new M2 instance, then also same issue persists. It started coming suddenly and I have tried all available solutions like setting permissions to folders and trying -vvv option and list command to find exact issue.
till now no success. My whole day wasted in debugging this only and now I am running out of thoughts.
If anyone have ideas?
I am using PHP 5.6 and Magento EE 2.1.7
Try Following Solution :
Solution 1 :Please mention setup_version in your module.xml file. Your module.xml file looks like:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Vendor_Module" setup_version="1.0.0"/>
</config>
Solution 2 : You need to give full permission to both var and pub folders recursively.
sudo chmod -R 777 var pub
if above solution not work then try following link
https://magento.stackexchange.com/questions/103774/magento-2-there-are-no-commands-defined-in-the-setup-namespace-on-windows
The reason for this error can be seen in the command output: php -f bin/magento.
This will work for most errors like There are no commands defined in the "..." namespace..
A fairly common cause is an error in xml files e.g. VendorName/ModuleName/etc/config.xml.

Problems installing Joomla plugins

I have a J2.5 install that simply refuses to install plugins using the extensions manager.
The directories are all writable, the Forum Post Assistant reports that session is writable, tmp path is ok, and the relevant directories have been made chmod777, and all files on the server have the same owner. Yet I still receive the following error when I try to install
JFTP: :mkdir: Bad response
JFTP: :chmod: Bad response
Component Install: Failed to create site directory: path.to/components/com_neorecruit
If I manually create the com_neorecruit directory then I receive the following error.
JFolder: :files: Path is not a folder. Path: path.to/administrator/components/com_neorecruit
JFolder: :files: Path is not a folder. Path: path.to/administrator/components/com_neorecruit
JInstaller: :Install: Cannot find XML setup file
JInstaller: :Install: Cannot find XML setup file
JFTP: :mkdir: Bad response
JFTP: :chmod: Bad response
Component Update: Failed to create admin directory:path.to/administrator/components/com_neorecruit
Any thoughts greatly appreciated.
All this turned out to be down to an incorrectly set ftp root, which was pointing at / rather than /htdocs.

Issue with dotNerInstaller Getting error "The installation package could not be opened. Verify..."

When I create exe within the C:\Program Files\dotNetInstaller\bin folder, and run it, it works perfect, install perfect, but when I try to install that exe from any other location/path, the error appears "The installation package could not be opened. Verify that the package exists and that you can access it. etc....."
I created an exe and moved to another XP system, on that system, it again gives me error ?
whats the solution ? Is there any admin rights issue ?
I have tried with both TRUE and FALSE of Administrator_Required option.
any idea how can I solve this issue ?
The issue is resolved now.
I should have written #CABPATH\ in the MSI->Package field. Before I was writing #TEMPPATH\
I think you can should add the location:
C:\Program Files\dotNetInstaller\bin
in the PATH environment variable. Follow the steps: Go to
My Computer->Right click->Properties->Advanced System Settings
->Click Environmental Variables. Now click PATH and then click EDIT.
In the variable value field, go to the end and append ';' (without quotes) and then add the above path.

Resources