Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Perlbrew on shared hosting

by Bod (Friar)
on Dec 03, 2020 at 19:19 UTC ( #11124597=perlquestion: print w/replies, xml ) Need Help??

Bod has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to upgrade from Perl v5.16.3 supplied by my shared hosting provider to Perl v5.32.0 by using Perlbrew. Perlbrew has installed fine by following the instruction \curl -L | bash from PuTTY.

Perl v5.32.0 has downloaded fine but it will not install. I run the command:

perlbrew install perl-5.32.0
and get the message
Installation process failed. To spot any issues, check /home/shoples1/perl5/perlbrew/build.perl-5.32.0.log
Looking at the logfile everything makes sense. It shows the questions for a guided installation with the answers to the questions already filled in. Then right at the end is this:
Use which C compiler? [cc] ./trygcc: line 10: /usr/bin/cc: Permission denied Uh-oh, the C compiler 'cc' doesn't seem to be working. ./trygcc: line 25: /usr/bin/gcc: Permission denied ./checkcc: line 10: /usr/bin/cc: Permission denied Uh-oh, the C compiler 'cc' doesn't seem to be working. You need to find a working C compiler. Either (purchase and) install the C compiler supplied by your OS vendo +r, or for a free C compiler try I cannot continue any further, aborting. ##### Brew Failed #####
I have previously installed modules from CPAN using PuTTY and SSH thanks to help from the Monastery. I know that I do not have access to install modules if I attempt it through cPanel but it has worked recently from an SSH shell.

Am I missing something obvious?

Is it possible that installing , will installing Perlbrew will upset any of the scripts already running on the server using Perl v5.16.3?

Replies are listed 'Best First'.
Re: Perlbrew on shared hosting
by marto (Cardinal) on Dec 03, 2020 at 19:32 UTC
    Permission denied

    Your host may not grant you access to a compiler, generally cheap shared hosting doesn't provide this. Previous modules successful modules installs may have been 'pure perl'.

Re: Perlbrew on shared hosting
by thomas895 (Deacon) on Dec 03, 2020 at 23:22 UTC

    Perhaps this will work: set up a VM (or container) on your PC of whatever Linux distro your host is using. Then create a home directory with the same username as your host assigned you in there (just so the paths match up later). Now install the C compiler and whatever dependencies are needed to run perlbrew. Finally, (S)FTP everything over to your hosting directory.

    "Excuse me for butting in, but I'm interrupt-driven..."
      set up a VM (or container) on your PC of whatever Linux distro your host is using.

      Not every shared hosting provider uses Linux. There are others that use one of the BSDs, SunOS/Solaris was and perhaps still is in use, and some really tough people provide(d) shared hosting on Windows.

      And regarding Linux: Debian, SuSE, RedHat, Gentoo, Arch Linux and their derivates should be quite common, but some providers also use other distributions or home-grown systems, some based on Linux From Scratch, some based on Nodereaper-knows-what. You need to reconstruct that system in the VM, including the libraries found on the hosting system.

      As a rule of thumb, expect the unexpected when using shared hosting. Don't be surprised to find really old and unmaintained systems running on refurbished or reused hardware. Expect really strange configurations, and workarounds stacked on older workarounds. And especially: Don't expect that the provider has a working backup system for shared hosting.

      Yes, there may be shared hosting providers with streamlined, well-maintained systems running on top hardware, and with good backups. But they can't be cheap.


      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      set up a VM

      That is probably an excellent idea...
      Although it is quite a faff and probably not worth the effort as Perl 5.16 will do everything I need it to do - although it would be nice to be able to strip here doc spaces!

      Before long I will need to put in some time and effort to arranging either a VPS or dedicated server although I probably cannot currently justify the cost of the latter.

      Part of me is resisting making that move because of the extra possibilities to break things with my very limited knowledge of a Linux environment.

        I wonder if copying the compiler binary to your home-dir and changing its restricted permissions can work. mkdir ~/bin; cp /usr/bin/gcc ~/bin; chmod 755 ~/bin/gcc . Then there must be a way to specify the compiler via an env var, like export CC=~/bin/gcc , Finally download a Perl source and compile it in your home-dir. Finally tell perlbrew that it has to manage that Perl too.

        VPS cost is like 5 euros per month for 4 cpu cores (spec?), 8 GB ram, and most importantly unlimited traffic (but not bandwidth). That 5 euros buy you all the flexibility you will need. HOWEVER, I can't really tell what number of simultaneous visits that system can support.

Re: Perlbrew on shared hosting
by bliako (Prior) on Dec 03, 2020 at 23:12 UTC

    Regarding your main problem, I misunderstood, thinking that you have full control of the host based on your previous post. It seems that you don't (as marto suggested). In which case you don't have much choice either.

Re: Perlbrew on shared hosting
by perlfan (Vicar) on Dec 07, 2020 at 20:54 UTC
    Our favorite hosting platform of choice^tm at one point could specifically provide access to gcc, so you may want to just make a support request for that to your hosting company (and any other 'build' requirements). Beyond that, yes it's super cheap(er) and easier to go with your own VPS.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11124597]
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2021-01-16 12:58 GMT
Find Nodes?
    Voting Booth?